Previous topic

speect.track_float – Floating Point Track

Next topic

speect.audio_riff – RIFF Audio Serialization – Waveform Container


A container class for audio objects. Provides a Speect native class for creating/adding audio objects. The audio samples are internally represented as floats.



Return the number of samples of this audio object.

Returns:Number of samples of this audio object.
Return type:int


Return the sample rate of the samples of this audio object.

Returns:Sample rate of this audio object (Hertz).
Return type:int

Return the waveform of this SAudio object in Python dict e.g.:

{'sampletype': 'int16',
 'samplerate': 16000,
 'samples': '...bytestring...samples....'}
Returns:Audio waveform.
Return type:dict
Note :Currently supports only ‘int16’ sample types. also adds a method to play audio objects through dev/dsp to the speect.SUtterance class.

Play utterance waveform. Will do nothing if the utterance does not have an “audio” feature.

Note :Uses internally.


This function first tries to import pyaudio (, and use pyaudio for playback. If pyaudio is not available then on posix systems, it tries to open an audio device (environment variable AUDIODEV, or fallback /dev/dsp) and write 16 bit little endian values to it.