Name
MIMEAudio
Synopsis
class MIMEAudio(_audiodata
,_subtype
=None,_encoder
=None,**_params
)
_audiodata
is a byte
string of audio data to pack in a message of MIME type
'audio/
_subtype
‘.
When _subtype
is None
,
_audiodata
must be parseable by standard
Python module sndhdr
to determine the subtype;
otherwise MIMEAudio
raises a
TypeError
. When
_encoder
is None
,
MIMEAudio
encodes data as Base 64, which is
generally optimal. Otherwise, _encoder
must be callable with one parameter m
, the
message being constructed; _encoder
must
then call m
.get_payload( )
to get the payload, encode the payload, put the encoded
form back by calling
m
.set_payload
, and set
m
['Content-Transfer-Encoding']
appropriately. MIMEAudio
passes the
_params
dictionary of keyword argument
names and values to
m
.add_header
to
construct m
’s
Content-Type
.
Get Python in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.