Gstreamer plugins

The audiotsm.gstreamer module implements three audio filters allowing to use the TSM procedures with gstreamer:

Note

If you are unsure which filter to choose, using audiotsm-phase-vocoder should give good results in most cases. You can listen to the output of the different procedures on various audio files and at various speeds on the examples page.

In order to use these audio filters, you should first import the module corresponding to the TSM procedure you want to use, for example:

import audiotsm.gstreamer.phasevocoder

Then, you should create the audio filter with Gst.ElementFactory.make, as follow:

tsm = Gst.ElementFactory.make("audiotsm-phase-vocoder")

You should then create a gstreamer pipeline using the audio filter you created. See examples/audiotsmcli_gst.py for an example of pipeline.

The audio filters work in the same manner as the scaletempo gstreamer plugin. You can change the playback rate by sending a seek event to the pipeline:

speed = 0.5
pipeline.seek(speed, Gst.Format.BYTES, Gst.SeekFlags.FLUSH,
              Gst.SeekType.NONE, -1, Gst.SeekType.NONE, -1)

The other parameters of the TSM procedure are available as properties, as documented for each of the procedures below.

OLA

The audiotsm.gstreamer.ola module implements an audio filter allowing to use the OLA procedure with gstreamer.

class audiotsm.gstreamer.ola.OLA

Bases: audiotsm.gstreamer.base.GstTSM

OLA gstreamer audio filter.

frame_length = <Mock name='mock.GObject.Property()' id='140713065119928'>

The length of the frames.

This is a write-only attribute, that will only take effect the next time the audio filter is setup (usually on the next song).

plugin_name = 'audiotsm-ola'

The plugin name, to be used in Gst.ElementFactory.make.

synthesis_hop = <Mock name='mock.GObject.Property()' id='140713065119928'>

The number of samples between two consecutive synthesis frames.

This is a write-only attribute, that will only take effect the next time the audio filter is setup (usually on the next song).

WSOLA

The audiotsm.gstreamer.wsola module implements an audio filter allowing to use the WSOLA procedure with gstreamer.

class audiotsm.gstreamer.wsola.WSOLA

Bases: audiotsm.gstreamer.base.GstTSM

WSOLA gstreamer audio filter.

frame_length = <Mock name='mock.GObject.Property()' id='140713065119928'>

The length of the frames.

This is a write-only attribute, that will only take effect the next time the audio filter is setup (usually on the next song).

plugin_name = 'audiotsm-wsola'

The plugin name, to be used in Gst.ElementFactory.make.

synthesis_hop = <Mock name='mock.GObject.Property()' id='140713065119928'>

The number of samples between two consecutive synthesis frames.

This is a write-only attribute, that will only take effect the next time the audio filter is setup (usually on the next song).

tolerance = <Mock name='mock.GObject.Property()' id='140713065119928'>

The maximum number of samples that the analysis frame can be shifted.

This is a write-only attribute, that will only take effect the next time the audio filter is setup (usually on the next song).

Phase Vocoder

The audiotsm.gstreamer.phasevocoder module implements an audio filter allowing to use the phase vocoder procedure with gstreamer.

class audiotsm.gstreamer.phasevocoder.PhaseVocoder

Bases: audiotsm.gstreamer.base.GstTSM

Phase vocoder gstreamer audio filter.

frame_length = <Mock name='mock.GObject.Property()' id='140713065119928'>

The length of the frames.

This is a write-only attribute, that will only take effect the next time the audio filter is setup (usually on the next song).

plugin_name = 'audiotsm-phase-vocoder'

The plugin name, to be used in Gst.ElementFactory.make.

synthesis_hop = <Mock name='mock.GObject.Property()' id='140713065119928'>

The number of samples between two consecutive synthesis frames.

This is a write-only attribute, that will only take effect the next time the audio filter is setup (usually on the next song).

tolerance = <Mock name='mock.GObject.Property()' id='140713065119928'>

The maximum number of samples that the analysis frame can be shifted.

This is a write-only attribute, that will only take effect the next time the audio filter is setup (usually on the next song).