Page 1 of 1

2 questions regarding LIBVLC audio functionality

Posted: 08 Nov 2012 11:01
by avi_tal
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.

Re: 2 questions regarding LIBVLC audio functionality

Posted: 08 Nov 2012 12:58
by Rémi Denis-Courmont
Obviously if your play callback does not actually play the samples, there will be no sound to hear...

Re: 2 questions regarding LIBVLC audio functionality

Posted: 08 Nov 2012 13:05
by avi_tal
Dear Remi,

Thanks allot for your reply!

Do you have a sample function that actually plays the sound?

Thanks,

Avi.

Re: 2 questions regarding LIBVLC audio functionality

Posted: 08 Nov 2012 17:07
by Rémi Denis-Courmont
No. The callback prototype is explained in the Doxygen documentation.