cpython/Lib/dos-8x3/test_sun.py

21 lines
398 B
Python
Raw Normal View History

1998-08-11 23:38:11 -03:00
from test_support import verbose, findfile, TestFailed
1997-04-02 02:13:34 -04:00
import sunaudiodev
import os
def play_sound_file(path):
fp = open(path, 'r')
data = fp.read()
fp.close()
try:
1998-03-26 18:14:20 -04:00
a = sunaudiodev.open('w')
1997-04-02 02:13:34 -04:00
except sunaudiodev.error, msg:
1998-03-26 18:14:20 -04:00
raise TestFailed, msg
1997-04-02 02:13:34 -04:00
else:
1998-03-26 18:14:20 -04:00
a.write(data)
a.close()
1997-04-02 02:13:34 -04:00
def test():
play_sound_file(findfile('audiotest.au'))
test()