- Posts: 4
- Joined: Fri May 20, 2022 9:56 am
- Real Name: Nikita Dedov
Hi Nikita,
Before you call IDeckLinkOutput::StartScheduledPlayback, ensure that you have sufficient audio samples and video frames in the scheduling queues. Ideally you should have sufficient audio samples equivalent to the number of prerolled video frames.
The IDeckLinkAudioOutputCallback::RenderAudioSamples callback is called periodically after IDeckLinkOutput::BeginAudioPreroll and is useful for maintaining the level of the buffered audio sample count after scheduled playback has started. During preroll, you can optionally use this callback to schedule video frames, as the IDeckLinkVideoOutputCallback::ScheduledFrameCompleted callback will only occur once scheduled playback has started.
Once you have both sufficient prerolled video frames and audio samples scheduled, then you should then call IDeckLinkOutput::StartScheduledPlayback. You can determine the buffered counts with IDeckLinkOutput::GetBufferedVideoFrameCount and IDeckLinkOutput::GetBufferedAudioSampleFrameCount, respectively.
My suspicion is that at the call to IDeckLinkOutput::StartScheduledPlayback, there are insufficient audio samples buffered, and so the DeckLink driver is outputting scheduled frames with no audio available at the requested stream time.
With respects to IDeckLinkOutput::WriteAudioSamplesSync, a call to this will write a limited number of samples into the driver to be played out immediately and bypassing the schedule audio buffer. This method is normally for writing short tones for output (as an example), but without using the schedule audio buffer it would be difficult to output continuous audio.
Regards
Cameron