Package email :: Package mime :: Module audio
[hide private]
[frames] | no frames]

Module audio

Class representing audio/* type MIME documents.

Classes [hide private]
MIMEAudio
Class for generating audio/* MIME documents.
Functions [hide private]
 
_whatsnd(data)
Try to identify a sound file type.
Variables [hide private]
  _sndhdr_MIMEmap = {'aifc': 'x-aiff', 'aiff': 'x-aiff', 'au': '...

Imports: sndhdr, StringIO, encoders, MIMENonMultipart


Function Details [hide private]

_whatsnd(data)

 

Try to identify a sound file type.

sndhdr.what() has a pretty cruddy interface, unfortunately. This is why we re-do it here. It would be easier to reverse engineer the Unix 'file' command and use the standard 'magic' file, as shipped with a modern Unix.


Variables Details [hide private]

_sndhdr_MIMEmap

Value:
{'aifc': 'x-aiff', 'aiff': 'x-aiff', 'au': 'basic', 'wav': 'x-wav'}