LibVLC 3.0.11 and pitch shift

*nix specific usage questions
pjwl
New Cone
New Cone
Posts: 3
Joined: 17 Oct 2020 11:58

LibVLC 3.0.11 and pitch shift

Postby pjwl » 17 Oct 2020 12:07

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

chubinou
Developer
Developer
Posts: 521
Joined: 23 Jul 2015 15:19

Re: LibVLC 3.0.11 and pitch shift

Postby chubinou » 19 Oct 2020 10:19

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

pjwl
New Cone
New Cone
Posts: 3
Joined: 17 Oct 2020 11:58

Re: LibVLC 3.0.11 and pitch shift

Postby pjwl » 20 Oct 2020 12:26

Thanks for the reply.

Is it possible to write this in the libvlc? So that it can be accessed trough the api.

chubinou
Developer
Developer
Posts: 521
Joined: 23 Jul 2015 15:19

Re: LibVLC 3.0.11 and pitch shift

Postby chubinou » 20 Oct 2020 17:20

You should be able to pass the options to a specific media, see:

https://www.videolan.org/developers/vlc ... dc88bf9e15

pjwl
New Cone
New Cone
Posts: 3
Joined: 17 Oct 2020 11:58

Re: LibVLC 3.0.11 and pitch shift

Postby pjwl » 21 Oct 2020 07:04

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");

thiago20
New Cone
New Cone
Posts: 1
Joined: 04 May 2021 23:14

Re: LibVLC 3.0.11 and pitch shift

Postby thiago20 » 04 May 2021 23:21

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?

User avatar
InTheWings
Developer
Developer
Posts: 1275
Joined: 07 Aug 2013 13:15
VLC version: crashing
Operating System: Linux
Contact:

Re: LibVLC 3.0.11 and pitch shift

Postby InTheWings » 07 May 2021 11:38

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.
:!: If you want your problem to be solved :
* First read troubleshooting guide VSG:Main
* Always provide verbose LOGS ! (command line or from gui)
* Always check your issue against a developer build from Nightly Build of VLC
* Tell us when your problem is solved !


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: No registered users and 8 guests