Reputation: 64276
I want to use gstreamer library to work with sound in my c++ application. Can you tell me there are any ways to change sound tempo, pitch, etc?
Thanks.
Upvotes: 0
Views: 2357
Reputation: 1104
Starting from max taldykin's suggestion, which returned an error in my version of GStreamer (0.10.35), I found a pipeline that does work. For example, to shift the song 1 step up maintaining the tempo, you should pitch 6%:
gst-launch-0.10 filesrc location=02-have_you_ever.mp3 ! \
decodebin ! audioconvert ! pitch pitch=1.06 tempo=1.0 ! \
audioconvert ! audioresample ! autoaudiosink
does the job for me.
Upvotes: 0
Reputation: 12898
With pitch plugin you can change sound pitch:
$ gst-launch filesrc location=sound.mp3
! decodebin ! audioconvert
! pitch pitch=3
! autoaudiosink
Or tempo:
$ gst-launch filesrc location=sound.mp3
! decodebin ! audioconvert
! pitch tempo=2
! autoaudiosink
Or rate.
Also there is huge LADSPA-library wrapper ladspa. I had some bad expirience with it, but maybe it is more stable now. It has several plugins to control pitch, tempo and much more.
This also may be of interest if you are planning to work with sound:
Upvotes: 3