ASPN ActiveState Programmer Network
  ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups | Web Services
SEARCH

Reference
ActivePython 2.5
Python Documentation
Library Reference
19. Multimedia Services
19.1 audioop -- Manipulate raw audio data
19.2 imageop -- Manipulate raw image data
19.3 aifc -- Read and write AIFF and AIFC files
19.4 sunau -- Read and write Sun AU files
19.5 wave -- Read and write WAV files
19.5.1 Wave read Objects
19.5.2 Wave write Objects
19.6 chunk -- Read IFF chunked data
19.7 colorsys -- Conversions between color systems
19.8 rgbimg -- Read and write ``SGI RGB'' files
19.9 imghdr -- Determine the type of an image
19.10 sndhdr -- Determine type of sound file
19.11 ossaudiodev -- Access to OSS-compatible audio devices

MyASPN >> Reference >> ActivePython 2.5 >> Python Documentation >> Library Reference >> 19. Multimedia Services
ActivePython 2.5 documentation

19.5 wave -- Read and write WAV files

The wave module provides a convenient interface to the WAV sound format. It does not support compression/decompression, but it does support mono/stereo.

The wave module defines the following function and exception:

open( file[, mode])
If file is a string, open the file by that name, other treat it as a seekable file-like object. mode can be any of
'r', 'rb'
Read only mode.
'w', 'wb'
Write only mode.
Note that it does not allow read/write WAV files.

A mode of 'r' or 'rb' returns a Wave_read object, while a mode of 'w' or 'wb' returns a Wave_write object. If mode is omitted and a file-like object is passed as file, file.mode is used as the default value for mode (the "b" flag is still added if necessary).

openfp( file, mode)
A synonym for open(), maintained for backwards compatibility.

exception Error
An error raised when something is impossible because it violates the WAV specification or hits an implementation deficiency.



See About this document... for information on suggesting changes.

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState 2004 All rights reserved