Hi,

On 4 December 2012 18:20, frank ernest <do...@mail.com> wrote:

> Opensuse 12.2 python3.2
> I would like to set the to get better control of the play back of wave
> files. I would like to set the play back volume, send the audio out only
> one of the two speakers and ajust the play back speed. I am completely
> blank on ideas of how to accomplish this and reading the recommendation in
> the documentation suggesting that you should not try to rewrite part of the
> standard library by your self I have decided to ask how to go about this.

Perhaps instead of reimplementing the library a new class should be created
> for basic audio manipulation.
> If so then how would I go about this?
> The wav file format is not exactly human readable.
> I have not seen anything similer to what I desire in the repo of 3rd party
> packages at the python web site.
>

Manipulating a Wav file or the data in a wav file is not the same thing as
controlling the audio hardware & audio mixer on your computer.   You can
change the playback volume of a file by either changing the file data
before playback, or by controlling the mixer during playback.  You seem to
be slightly conflating these 2 things.  So what is it you're trying to do
in reality?  Control the volume of playback or manipulate an existing WAV
file in terms of the volume (amplitude) of the audio waveform in the file?

Anyway, the mixer volume can be controlled with the oss_mixer_device object
(using methods set() and get())  which is part of the ossaudiodev model
you've already found.

As for actually getting data into and out of wave files (reading data from
them, and writing them), that's what the wave module is useful for.
 However it doesn't provide much if anything in the way of actually
manipulating audio -- it's only use is to hide the detail of the Wav file,
allowing you to get the raw data in the file and write it without having to
worry about the actual Wav format.

For more complex audio transformations you might consider the pysox module
in conjunction with the sox library:  http://pypi.python.org/pypi/pysox
As a bit of background: "Sox" is a very capable sound manipulation program
which is basically a wrapper over the underlying programming library called
"libsox".   "pysox" then is a Python wrapper for libsox that allows you to
use it from within Python. It's probably the easiest way to do
"standard"-ish transformations on sound files.

Walter
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to