Page 1 of 1

setting gain value has no effect

Posted: 13 Feb 2017 09:47
by david_pureal
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.

Re: setting gain value has no effect

Posted: 14 Feb 2017 16:24
by mangokm40
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. :)

Re: setting gain value has no effect

Posted: 14 Feb 2017 16:29
by mangokm40
...also...

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

Re: setting gain value has no effect

Posted: 15 Feb 2017 04:25
by david_pureal
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.

Re: setting gain value has no effect

Posted: 15 Feb 2017 04:37
by david_pureal
...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.