setting gain value has no effect

This forum is about all development around libVLC.
david_pureal
New Cone
New Cone
Posts: 3
Joined: 13 Feb 2017 09:32

setting gain value has no effect

Postby david_pureal » 13 Feb 2017 09:47

Hello!
I am trying to set gain value by the "libvlc_media_add_option" api, unfortunately there is no effect.
But the comand line works, "cvlc --audio-filter=gain file:///media/psf/Home/Documents/personal/music/thingsyoudtknow.mp3 --gain=0"
Did I miss something?

Code: Select all

inst = libvlc_new(0, NULL); m = libvlc_media_new_location (inst, "file:///media/psf/Home/Documents/personal/music/test/thingsyoudontknow.mp3"); libvlc_media_add_option(m, "audio-filter=gain"); libvlc_media_add_option(m, "gain=0"); mp = libvlc_media_player_new_from_media(m); libvlc_media_player_play(mp);
besides, my vlc version is "VLC media player 2.1.6 Rincewind".
Thanks in advance.

mangokm40
Cone that earned his stripes
Cone that earned his stripes
Posts: 130
Joined: 20 May 2010 20:00

Re: setting gain value has no effect

Postby mangokm40 » 14 Feb 2017 16:24

According to this link: http://www.videolan.org/developers/vlc/ ... defcad3e6f

..."We recommend using libvlc_media_new_path() instead when dealing with local files."

I don't know if that will make any difference for your problem, of course. :)

mangokm40
Cone that earned his stripes
Cone that earned his stripes
Posts: 130
Joined: 20 May 2010 20:00

Re: setting gain value has no effect

Postby mangokm40 » 14 Feb 2017 16:29

...also...

I couldn't find the details for "audio-filter=gain". Are you sure this is a media option and not an instance option?

david_pureal
New Cone
New Cone
Posts: 3
Joined: 13 Feb 2017 09:32

Re: setting gain value has no effect

Postby david_pureal » 15 Feb 2017 04:25

According to this link: http://www.videolan.org/developers/vlc/ ... defcad3e6f

..."We recommend using libvlc_media_new_path() instead when dealing with local files."

I don't know if that will make any difference for your problem, of course. :)
Thanks for your reply :) . I tried libvlc_media_new_path with absolute path, there is no difference.

david_pureal
New Cone
New Cone
Posts: 3
Joined: 13 Feb 2017 09:32

Re: setting gain value has no effect

Postby david_pureal » 15 Feb 2017 04:37

...also...

I couldn't find the details for "audio-filter=gain". Are you sure this is a media option and not an instance option?
I'm not sure :oops: I find this option from the audio section in "vlc -H".
Hi, brother, my goal is making music sound the same loudness. Firstly I got the music file's loudness level by mp3gain.
But I can't modify the music file, so I need to tell vlc how much gain should be applied when playing the music file.
Could you give me some clue about which API can achieve this?
thanks.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 4 guests