arduino-audio-tools
Public Member Functions | Protected Attributes | List of all members
VideoAudioBufferedSync Class Reference

Logic to Synchronize video and audio output: we use a buffer to store the audio and instead of delaying the frames with delay() we play audio. The bufferSize defines the audio buffer in bytes. The correctionMs is used to slow down or speed up the playback of the video to prevent any audio buffer underflows. More...

#include <Video.h>

Inheritance diagram for VideoAudioBufferedSync:
VideoAudioSync

Public Member Functions

 VideoAudioBufferedSync (int bufferSize, int correctionMs)
 
void delayVideoFrame (int32_t microsecondsPerFrame, uint32_t time_used_ms)
 
void writeAudio (Print *out, uint8_t *data, size_t size)
 Process the audio data.
 

Protected Attributes

int correction_ms = 0
 
Printp_out = nullptr
 
RingBuffer< uint8_t > ring_buffer {0}
 

Detailed Description

Logic to Synchronize video and audio output: we use a buffer to store the audio and instead of delaying the frames with delay() we play audio. The bufferSize defines the audio buffer in bytes. The correctionMs is used to slow down or speed up the playback of the video to prevent any audio buffer underflows.

Author
Phil Schatzmann

Member Function Documentation

◆ delayVideoFrame()

void delayVideoFrame ( int32_t  microsecondsPerFrame,
uint32_t  time_used_ms 
)
inlinevirtual

Adds a delay after playing a frame to process with the correct frame rate. If the playing is too slow we return the mod to select the frames

Reimplemented from VideoAudioSync.


The documentation for this class was generated from the following file: