generating audio signals

N

nicke

I'm running linux and would like to generate specific frequencies and
play them(in OSS) or alternatively save them as wav files, how should I
accomplish this? Using python to play and generate is not strictly
necessary, as long as I can invoke the command from python.
I know for example xmms can do this, but I want a command-line only solution.

thanks
 
B

Bengt Richter

I'm running linux and would like to generate specific frequencies and
play them(in OSS) or alternatively save them as wav files, how should I
accomplish this? Using python to play and generate is not strictly
necessary, as long as I can invoke the command from python.
I know for example xmms can do this, but I want a command-line only solution.
Perhaps
http://docs.python.org/lib/module-wave.html
will help. I used it to create an echo effect toy for my grandson by reading existing .wav sound effect
files and adding delayed reduced-aplitude feeback to itself and writing another file. Parameters were
distance in feet to a reflecting wall (assuming 1000 ft/sec sound speed ;-) and relection volume factor.

Not hard. Maybe make yourself a little utility first that will show you the specs for any .wav file (i.e.,
sampling frequency, bytes per sample, channels, etc.) I don't recall at the moment whether you have to
deal with signed or offset amplitude values, but it won't be hard.

This won't play the sounds though.

Regards,
Bengt Richter
 
C

Cappy2112

Maybe make yourself a little utility first that will show you the
specs for any .wav file (i.e.,
You can do this with one function call - wave.Wave_read.getparams()
import wave
wave.open("filename","b")
wave.Wave_read.getparams()
 
B

Bengt Richter

You can do this with one function call - wave.Wave_read.getparams()
import wave
wave.open("filename","b")
wave.Wave_read.getparams()
Yeah, I know ;-) I expected the OP to discover that really quick,
and enjoy an early tidbit of success, maybe printing the parameters
in a pretty format to his taste ;-)

Regards,
Bengt Richter
 
N

nicke

On Tue, 22 Mar 2005 00:51:57 GMT
Yeah, I know ;-) I expected the OP to discover that really quick,
and enjoy an early tidbit of success, maybe printing the parameters
in a pretty format to his taste ;-)

Regards,
Bengt Richter

already found it and used it, but did some more research...
packed/unpacked the wave files, made programs for generating
frequencies, playing them, saving them, and plotting the files as
amplitude as a function of time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,052
Latest member
LucyCarper

Latest Threads

Top