| Guido van Rossum | 3e06ab1 | 2000-06-29 19:35:29 +0000 | [diff] [blame] | 1 | from test_support import verbose, findfile, TestFailed |
| 2 | import linuxaudiodev | ||||
| 3 | import os | ||||
| 4 | |||||
| 5 | def play_sound_file(path): | ||||
| 6 | fp = open(path, 'r') | ||||
| 7 | data = fp.read() | ||||
| 8 | fp.close() | ||||
| 9 | try: | ||||
| 10 | a = linuxaudiodev.open('w') | ||||
| 11 | except linuxaudiodev.error, msg: | ||||
| 12 | raise TestFailed, msg | ||||
| 13 | else: | ||||
| 14 | a.write(data) | ||||
| 15 | a.close() | ||||
| 16 | |||||
| 17 | def test(): | ||||
| 18 | play_sound_file(findfile('audiotest.au')) | ||||
| 19 | |||||
| 20 | test() | ||||