[Python-Dev] Change to ossaudiodev setparameters() method

Guido van Rossum guido@python.org
Mon, 26 May 2003 02:39:59 -0400


> Currently, oss_audio_device objects have a setparameters() method with a
> rather silly interface:
> 
>   oss.setparameters(sample_rate, sample_size, num_channels, format [, emulate])
> 
> This is silly because 1) 'sample_size' is implicit in 'format', and 2)
> the implementation doesn't actually *use* sample_size for anything -- it
> just checks that you have passed in the correct sample size, ie. if you
> specify an 8-bit format, you must pass sample_size=8.  (This is code
> inherited from linuxaudiodev that I never got around to cleaning up.)
> 
> In addition to being silly, this is not the documented interface.  The
> docs don't mention the 'sample_size' argument at all.  Presumably the
> doc writer realized the silliness and was going to pester me to remove
> 'sample_size', but never got around to it.  (Lot of that going around.)
> 
> So, even though we're in a beta cycle, am I allowed to change the code
> so it's 1) sensible and 2) consistent with the documentation?

Yes.  I like silliness in a MP skit, but not in my APIs. :-)

--Guido van Rossum (home page: http://www.python.org/~guido/)