I use the wave module
for example .
origAudio = wave.open("son.wav",'r')
raise Error, 'file does not start with RIFF id'
wave.Error: file does not start with RIFF id
If you wish to continue after an expection has been raised you must catch it:
import wave try: origAudio = wave.open("son.wav",'r') except wave.Error as e: # if you get here it means an error happende, maybe you should warn the user # but doing pass will silently ignore it pass