arduino-audio-tools
Loading...
Searching...
No Matches
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_tring_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

Constructor & Destructor Documentation

◆ VideoAudioBufferedSync()

VideoAudioBufferedSync ( int  bufferSize,
int  correctionMs 
)
inline

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.

◆ writeAudio()

void writeAudio ( Print out,
uint8_t data,
size_t  size 
)
inlinevirtual

Process the audio data.

Reimplemented from VideoAudioSync.

Member Data Documentation

◆ correction_ms

int correction_ms = 0
protected

◆ p_out

Print* p_out = nullptr
protected

◆ ring_buffer

RingBuffer<uint8_t> ring_buffer {0}
protected

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