[Sndobj-devel] Recording Sound w/ pysndobj
Status: Abandoned
Brought to you by:
veplaini
From: Nikolas F. <cor...@gm...> - 2010-06-09 18:05:50
|
Hello, I'm a two week old newbie to OOP and python, but I have lots of Matlab experience from my research. I found psysndobj a few days ago, and it looks promising for my current foray into python audio. My long-term goals using pysndobj are: (1) buffer audio streaming in from a microphone (2) plot the spectrum of the audio stored in the buffer (3) give the user an option to select a band of frequencies from the display, in order to band-pass filter subsequent audio buffers around the chosen frequency-band (3) update the buffer and spectrum display every second or so I gather that pysndobj can do the recording, buffering and filtering, and I was thinking of pyQT for the GUI. I'm currently far, FAR away from those goals. Currently, I only understand how to monitor my mic: ###Start Code import sndobj import time #Create input and output objects input = sndobj.SndRTIO(1, sndobj.SND_INPUT) output = sndobj.SndRTIO(1, sndobj.SND_OUTPUT) #Setup input object mic = sndobj.SndIn(input) #Set output output.SetOutput(1, mic) #threading thread = sndobj.SndThread() thread.AddObj(input, sndobj.SNDIO_IN) thread.AddObj(output, sndobj.SNDIO_OUT) thread.AddObj(mic) #start processing thread.ProcOn() time.sleep(30) thread.ProcOff() ###End Code Does anyone have any **simple** examples of how to use SndBuffer in pysndobj? Comments/other recommendations on using pyQT for displaying and interacting with the spectrum? I realize that this is a high-level inqury, but I'm floundering a bit with coding, since its a bit difficult to find relevant examples online, which is how I learned a lot in Matlab (by editing other people's code to my purpose). Thanks! -- Nik |