2 questions regarding LIBVLC audio functionality
Posted: 08 Nov 2012 11:01
Dear friends,
I have 2 questions regarding LIBVLC audio manipulations:
1. When I set a "play" callback for the audio, there is no sound. This occurs even if the "play" callback function is empty. Following is my code:
//Set callback:
libvlc_audio_set_callbacks(mpSourceMedia, (libvlc_audio_play_cb)&playMediaAudio, NULL, NULL, NULL, NULL, &contextSourceMedia);
//Play callback:
void playMediaAudio(void *data, void *samples, unsigned count, int64_t pts)
{
}
2. When I use VIRTUAL audio device and rout the audio source to it, the volume control does not work (the virtual audio device HAS volume control) and stays at 100.
I route the audio using the following code:
err = libvlc_audio_output_set(mpSourceMedia, audioDevices[SHARED_CABLE].container_name);
libvlc_audio_output_device_set(mpSourceMedia, audioDevices[SHARED_CABLE].container_name, audioDevices[SHARED_CABLE].device_name);
And set the volume using the following code:
err = libvlc_audio_set_volume( mpSourceMedia, 0 );
Windows handles this device correctly.
Your kind help is greatly appreciated!
Thanks,
Avi.
I have 2 questions regarding LIBVLC audio manipulations:
1. When I set a "play" callback for the audio, there is no sound. This occurs even if the "play" callback function is empty. Following is my code:
//Set callback:
libvlc_audio_set_callbacks(mpSourceMedia, (libvlc_audio_play_cb)&playMediaAudio, NULL, NULL, NULL, NULL, &contextSourceMedia);
//Play callback:
void playMediaAudio(void *data, void *samples, unsigned count, int64_t pts)
{
}
2. When I use VIRTUAL audio device and rout the audio source to it, the volume control does not work (the virtual audio device HAS volume control) and stays at 100.
I route the audio using the following code:
err = libvlc_audio_output_set(mpSourceMedia, audioDevices[SHARED_CABLE].container_name);
libvlc_audio_output_device_set(mpSourceMedia, audioDevices[SHARED_CABLE].container_name, audioDevices[SHARED_CABLE].device_name);
And set the volume using the following code:
err = libvlc_audio_set_volume( mpSourceMedia, 0 );
Windows handles this device correctly.
Your kind help is greatly appreciated!
Thanks,
Avi.