[linux-audio-dev] wave module in Python

Lars Luthman lars.luthman at gmail.com
Mon Feb 5 11:15:34 UTC 2007


On Sun, 2007-02-04 at 12:17 -0200, Silver Rock wrote:
> hallo, 
>  
> supose i´ve opened a sound with the wave module:
>  
> >>> import wave
> >>> sound=wave.open(filename,'rb')
>  
> now this is strange:
>  
> >>> sound.getnframes() != len(sound.readframes(sound.getnframes())
> True
>  
>  Why so?

The documentation says

readframes(
n)
        Reads and returns at most n frames of audio, as a string of
        bytes.
        
Note the "at most n frames". Most I/O functions work like this, they try
to give you as much data as you request but if they get interrupted by a
signal or something else they may return less than that. What happens if
you call readframes() again?


--ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.linuxaudio.org/pipermail/linux-audio-dev/attachments/20070205/76fa5c50/attachment.pgp>


More information about the Linux-audio-dev mailing list