Page 1 of 1
LibVLC 3.0.11 and pitch shift
Posted: 17 Oct 2020 12:07
by pjwl
Hello,
I'm using libvlc 3.0.11 so to write my own media player and I would like to know how I can access the audio pitch shifter. When using the VLC media player, it is possible to change the pitch while the audio is playing.
Looking trough the libvlc and its api I couldn't find any function which is capable of doing this. Is it possible to add and function to libvlc for example: libvlc_audio_set_pitch which is using the audio pitch shifter who is available in the vlc mediaplayer?
Kind regards
pjwl
Re: LibVLC 3.0.11 and pitch shift
Posted: 19 Oct 2020 10:19
by chubinou
the pitch shifter is a plugin (scaletempo_pitch), libvlc doesn't provide an API to manipulate filter directly, you need to add them to your input, with something like
--audio-filter=scaletempo_pitch --pitch-shift=5
Re: LibVLC 3.0.11 and pitch shift
Posted: 20 Oct 2020 12:26
by pjwl
Thanks for the reply.
Is it possible to write this in the libvlc? So that it can be accessed trough the api.
Re: LibVLC 3.0.11 and pitch shift
Posted: 20 Oct 2020 17:20
by chubinou
You should be able to pass the options to a specific media, see:
https://www.videolan.org/developers/vlc ... dc88bf9e15
Re: LibVLC 3.0.11 and pitch shift
Posted: 21 Oct 2020 07:04
by pjwl
Thanks for the answer.
I already tried it, but I couldn't get it to work, maybe I did wrong:
Code: Select all
libvlc_media_add_option(vlcMedia, ":audio-filter=scaletempo_pitch");
libvlc_media_add_option(vlcMedia, ":pitch-shift=1.0");
Re: LibVLC 3.0.11 and pitch shift
Posted: 04 May 2021 23:21
by thiago20
Thanks for the answer.
I already tried it, but I couldn't get it to work, maybe I did wrong:
Code: Select all
libvlc_media_add_option(vlcMedia, ":audio-filter=scaletempo_pitch");
libvlc_media_add_option(vlcMedia, ":pitch-shift=1.0");
I have the same problem.
I've tried a lot of things and I can't seem to get it to work.
My code in C#:
Code: Select all
_media.AddOption(":audio-filter=scaletempo_pitch");
_media.AddOption(":pitch-shift=4");
_mp.Play(_media);
pjwl, did you get it?
Re: LibVLC 3.0.11 and pitch shift
Posted: 07 May 2021 11:38
by InTheWings
I have the same problem.
I've tried a lot of things and I can't seem to get it to work.
Looking at the source code validates my understanding of your issue.
According to the way the variables are handled you can't change the pitch outside of callbacks from the UI.
Not sure why this was designed like this.