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

21 lines
398 B
Python
Raw Normal View History

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