Top |
GObject ╰── GInitiallyUnowned ╰── GstObject ╰── GstElement ╰── GstBaseTransform ╰── GstScaletempo
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.
1 2 3 |
filesrc location=media.ext ! decodebin name=d \ d. ! queue ! audioconvert ! audioresample ! scaletempo ! audioconvert ! audioresample ! autoaudiosink \ d. ! queue ! videoconvert ! autovideosink |
OR
1 |
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 (“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. One can use the “search” propery to tune how far the algoritm looks.
plugin |
audiofx |
author |
Rov Juvano <rovjuvano@users.sourceforge.net> |
class |
Filter/Effect/Rate |
name |
sink |
direction |
sink |
presence |
always |
details |
audio/x-raw, format=(string)F32LE, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ] |
audio/x-raw, format=(string)F64LE, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ] | |
audio/x-raw, format=(string)S16LE, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ] |
name |
src |
direction |
source |
presence |
always |
details |
audio/x-raw, format=(string)F32LE, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ] |
audio/x-raw, format=(string)F64LE, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ] | |
audio/x-raw, format=(string)S16LE, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ] |
“overlap”
property “overlap” gdouble
Percentage of stride to overlap.
Flags: Read / Write
Allowed values: [0,1]
Default value: 0.2
“rate”
property “rate” gdouble
Current playback rate.
Flags: Read
Allowed values: [-2.14748e+09,2.14748e+09]
Default value: 1
“search”
property “search” guint
Length in milliseconds to search for best overlap position.
Flags: Read / Write
Allowed values: <= 500
Default value: 14