[Python-Dev] Test results of linuxaudiodev.c

Michael Hudson mwh21@cam.ac.uk
30 Jun 2000 00:33:37 +0100


Ka-Ping Yee <pingster@ilm.com> writes:

> On 29 Jun 2000, Michael Hudson wrote:
> > $ play audiotest.au
> > 
> > sounds fine,
> > 
> > $  ../../../build/python regrtest.py test_linuxaudiodev.py \
> > test_linuxaudiodev
> > 
> > sounds horrible; it sounds like it's being rammed through at far too
> > high a volume
> 
> Sounds like u-law to me.  linuxaudiodev.c selects /dev/dsp by
> default, which accepts raw data, not .au format.
> 
> Try setting the environment variable AUDIODEV to /dev/audio
> before running the test script.  Does that work any better?

That's the ticket.  "play" and the test now sound identical, modulo
some pops & cracks at the start and end of the test.  I presume what
follows is thus a good idea?

Index: test_linuxaudiodev.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_linuxaudiodev.py,v
retrieving revision 1.1
diff -u -r1.1 test_linuxaudiodev.py
--- test_linuxaudiodev.py       2000/06/10 04:22:57     1.1
+++ test_linuxaudiodev.py       2000/06/29 23:32:55
@@ -17,4 +17,6 @@
 def test():
     play_sound_file(findfile('audiotest.au'))
 
+os.environ["AUDIODEV"] = "/dev/audio"
+
 test()

Cheers,
M.