scaletempo

scaletempo — Sync audio tempo with playback rate

Synopsis

                    GstScaletempo;

Description

Example pipelines

Scale tempo while maintaining pitch (WSOLA-like technique with cross correlation) Inspired by SoundTouch library by Olli Parviainen

Use Sceletempo to apply playback rates without the chipmunk effect.

filesrc location=media.ext ! decodebin name=d \
    d. ! queue ! audioconvert ! audioresample ! scaletempo ! audioconvert ! audioresample ! autoaudiosink \
    d. ! queue ! ffmpegcolorspace ! autovideosink

OR

playbin uri=... audio_sink="scaletempo ! audioconvert ! audioresample ! autoaudiosink"

When an application sends a seek event with rate != 1.0, Scaletempo applies the rate change by scaling the tempo without scaling the pitch.

Scaletempo works by producing audio in constant sized chunks (a "stride") but consuming chunks proportional to the playback rate.

Scaletempo then smooths the output by blending the end of one stride with the next ("overlap").

Scaletempo smooths the overlap further by searching within the input buffer for the best overlap position. Scaletempo uses a statistical cross correlation (roughly a dot-product). Scaletempo consumes most of its CPU cycles here.

Synopsis

Element Information

plugin

scaletempo

author

Rov Juvano <rovjuvano@users.sourceforge.net>

class

Filter/Effect/Rate

Element Pads

name

sink

direction

sink

presence

always

details

audio/x-raw-float, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ], endianness=(int)1234, width=(int)32

audio/x-raw-int, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ], endianness=(int)1234, width=(int)16, depth=(int)16, signed=(boolean)true

name

src

direction

source

presence

always

details

audio/x-raw-float, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ], endianness=(int)1234, width=(int)32

audio/x-raw-int, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ], endianness=(int)1234, width=(int)16, depth=(int)16, signed=(boolean)true

Details

GstScaletempo

typedef struct {
  GstBaseTransform element;
} GstScaletempo;