1998-04-23 22:13:30 +02:00
|
|
|
from test_support import verbose, findfile, TestFailed
|
1997-01-07 22:05:29 +01:00
|
|
|
import sunaudiodev
|
|
|
|
import os
|
|
|
|
|
|
|
|
def play_sound_file(path):
|
|
|
|
fp = open(path, 'r')
|
|
|
|
data = fp.read()
|
|
|
|
fp.close()
|
1997-01-13 21:53:46 +01:00
|
|
|
try:
|
1998-03-26 20:42:58 +01:00
|
|
|
a = sunaudiodev.open('w')
|
1997-01-13 21:53:46 +01:00
|
|
|
except sunaudiodev.error, msg:
|
1998-03-26 20:42:58 +01:00
|
|
|
raise TestFailed, msg
|
1997-01-13 21:53:46 +01:00
|
|
|
else:
|
1998-03-26 20:42:58 +01:00
|
|
|
a.write(data)
|
|
|
|
a.close()
|
1997-01-07 22:05:29 +01:00
|
|
|
|
|
|
|
def test():
|
1997-01-13 21:34:44 +01:00
|
|
|
play_sound_file(findfile('audiotest.au'))
|
1997-01-07 22:05:29 +01:00
|
|
|
|
|
|
|
test()
|