Newbie SWMixer / numpy help - AssertionError

Robert Kern robert.kern at gmail.com
Sat Feb 7 17:47:55 EST 2009


On 2009-02-07 08:46, Peter Chant wrote:
> Hello,
>
> I'm a bit of a python newby.  I want to play and record sound
> simultaneously.  SWMixer seems able to do this but the examples use WAV
> files.  I'm trying to play a test tone.  Can anyone give me a steer as to
> why this fails?

Looking at the SWMixer docs, you probably want

   snd = swmixer.Sound(data=tone_data)

Well, sort of. You probably need to scale your data and convert it to int16 
format. It's currently in floating point format.

When asking about why something fails, it helps a lot if you specify exactly how 
it fails and what you expected to happen. Copy-and-paste any error messages exactly.

If you need more help with SWMixer's API, I recommend asking the author. It's 
not in widespread use, so he can probably give you better and faster help than 
we can.

If you need more help with numpy, specifically, you can ask on the 
numpy-discussion mailing list. numpy *is* in widespread use, but there's a 
higher concentration of helpful numpy users over there.

   http://www.scipy.org/Mailing_Lists

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco




More information about the Python-list mailing list