summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ossaudiodev.py
diff options
context:
space:
mode:
authorGreg Ward <gward@python.net>2003-05-29 00:23:17 (GMT)
committerGreg Ward <gward@python.net>2003-05-29 00:23:17 (GMT)
commit080c110172870501ad91361ebfd93624678eb861 (patch)
tree1f3e8e04d76c159c8819e892563ca262b435b2c3 /Lib/test/test_ossaudiodev.py
parentd1c5510b997a1cf12dcc2619ba7b8663df5f4009 (diff)
downloadcpython-080c110172870501ad91361ebfd93624678eb861.zip
cpython-080c110172870501ad91361ebfd93624678eb861.tar.gz
cpython-080c110172870501ad91361ebfd93624678eb861.tar.bz2
Order and number of arguments to setparameters() has changed.
Rename 'a' (the audio device) to 'dsp' everywhere.
Diffstat (limited to 'Lib/test/test_ossaudiodev.py')
-rw-r--r--Lib/test/test_ossaudiodev.py47
1 files changed, 23 insertions, 24 deletions
diff --git a/Lib/test/test_ossaudiodev.py b/Lib/test/test_ossaudiodev.py
index 51fdab2..6bc5923 100644
--- a/Lib/test/test_ossaudiodev.py
+++ b/Lib/test/test_ossaudiodev.py
@@ -32,7 +32,7 @@ def read_sound_file(path):
def play_sound_file(data, rate, ssize, nchannels):
try:
- a = ossaudiodev.open('w')
+ dsp = ossaudiodev.open('w')
except IOError, msg:
if msg[0] in (errno.EACCES, errno.ENODEV, errno.EBUSY):
raise TestSkipped, msg
@@ -45,47 +45,46 @@ def play_sound_file(data, rate, ssize, nchannels):
fmt = ossaudiodev.AFMT_S16_BE
# at least check that these methods can be invoked
- a.bufsize()
- a.obufcount()
- a.obuffree()
- a.getptr()
- a.fileno()
+ dsp.bufsize()
+ dsp.obufcount()
+ dsp.obuffree()
+ dsp.getptr()
+ dsp.fileno()
# set parameters based on .au file headers
- a.setparameters(rate, 16, nchannels, fmt)
- a.write(data)
- a.flush()
- a.close()
+ dsp.setparameters(fmt, nchannels, rate)
+ dsp.write(data)
+ dsp.flush()
+ dsp.close()
def test_errors():
- a = ossaudiodev.open("w")
- size = 8
+ dsp = ossaudiodev.open("w")
fmt = ossaudiodev.AFMT_U8
rate = 8000
nchannels = 1
try:
- a.setparameters(-1, size, nchannels, fmt)
- except ValueError, msg:
+ dsp.setparameters(fmt, nchannels, -1)
+ except ossaudiodev.error, msg:
print msg
try:
- a.setparameters(rate, -2, nchannels, fmt)
- except ValueError, msg:
+ dsp.setparameters(fmt, nchannels, rate)
+ except ossaudiodev.error, msg:
print msg
try:
- a.setparameters(rate, size, 3, fmt)
- except ValueError, msg:
+ dsp.setparameters(fmt, 3, rate)
+ except ossaudiodev.error, msg:
print msg
try:
- a.setparameters(rate, size, nchannels, 177)
- except ValueError, msg:
+ dsp.setparameters(177, nchannels, rate)
+ except ossaudiodev.error, msg:
print msg
try:
- a.setparameters(rate, size, nchannels, ossaudiodev.AFMT_U16_LE)
- except ValueError, msg:
+ dsp.setparameters(ossaudiodev.AFMT_U16_LE, nchannels, rate)
+ except ossaudiodev.error, msg:
print msg
try:
- a.setparameters(rate, 16, nchannels, fmt)
- except ValueError, msg:
+ dsp.setparameters(rate, nchannels, fmt)
+ except ossaudiodev.error, msg:
print msg
def test():