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.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access