.wav music problems

Chris Liechti cliechti at gmx.net
Tue Jul 30 19:45:51 EDT 2002


"Seth Ainsley" <sethtoday at hotmail.com> wrote in
news:mailman.1028071080.13682.python-list at python.org: 

baahh HTML mail... not eveyones friend, please try to post text only.

> I'm having problems getting the wave module to work. I
> tried this, and you can see what happened:
> from wave import * #import the wave module

never use import * with the wave module. you won't be able to open normal 
files afterwards. use:

import wave

> q=wave.open('gemstorm.mid','r') #open gemstorm.mid in read
> Traceback (most recent call last): ...
> NameError: name 'wave' is not defined

because you didn't imported the module under that name. if you change the 
import above as i sugest it will find the module.

> "Error: file does not start with RIFF id"

that is because a .mid (MIDI) file has absolutely nothing in common with a 
.wav (WAVE) file. a midi contains notes to play, a wav is a digital 
recording.

you can do diffrent things
a) use a module that can work with midi (pygame might be able to play them)
b) convert it to a wav. google should help to find a software for that.

chris

-- 
Chris <cliechti at gmx.net>




More information about the Python-list mailing list