I have the same problem in my project.
But the following code works as expected :
Code: Select all
#include <iostream>
#include <vlc/vlc.h>
#include <cstdlib>
#include <unistd.h>
int main(int argc, char **argv)
{
libvlc_instance_t *vlcInstance;
libvlc_media_player_t *mp;
libvlc_media_t *media;
vlcInstance = libvlc_new (argc, argv);
mp = libvlc_media_player_new(vlcInstance);
media = libvlc_media_new_path(vlcInstance, "sound.ogg");
libvlc_media_player_set_media(mp, media);
libvlc_media_player_play (mp);
libvlc_audio_set_volume(mp, 100);
sleep(3);
libvlc_audio_set_volume(mp, 0);
sleep(3);
libvlc_audio_set_volume(mp, 100);
sleep(3);
libvlc_media_player_release(mp);
libvlc_release(vlcInstance);
return 0;
}
With this program, the volume changes as expected but I see no message in the log (with -vvv). How can we see them ?