AudioData Class

Inheritance diagram of AudioData

class AudioData(data, length, timestamp, duration, events)

A single packet of audio data.

This class is used internally by pyglet.

  • data – Sample data.
  • length – Size of sample data, in bytes.
  • timestamp – Time of the first sample, in seconds.
  • duration – Total data duration, in seconds.
  • events – List of events contained within this packet. Events are timestamped relative to this audio packet.


__init__(data, length, timestamp, duration, events)


consume(bytes, audio_format) Remove some data from beginning of packet.
get_string_data() Return data as a string.


AudioData.consume(bytes, audio_format)

Remove some data from beginning of packet. All events are cleared.


Return data as a string. (Python 3: return as bytes)

Table Of Contents

Previous topic

AbstractSourceLoader Class

Next topic

AudioFormat Class