9 #ifndef YARP_DEV_CIRCULARAUDIOBUFFER_H
10 #define YARP_DEV_CIRCULARAUDIOBUFFER_H
23 template <
typename SAMPLE>
35 return (end + 1) % maxsize.size == start;
51 end = (end + 1) % maxsize.size;
54 printf (
"ERROR: %s buffer overrun!\n", name.c_str());
55 start = (start + 1) % maxsize.size;
67 i = maxsize.size - start + end;
75 printf (
"ERROR: %s buffer underrun!\n", name.c_str());
77 SAMPLE elem = elems[start];
78 start = (start + 1) % maxsize.size;
100 static_assert (std::is_same<unsigned char, SAMPLE>::value ||
101 std::is_same<unsigned short int, SAMPLE>::value ||
102 std::is_same<unsigned int, SAMPLE>::value,
103 "CircularAudioBuffer can be specialized only as <unsigned char>, <unsigned short int>, <unsigned int>");
CircularAudioBuffer(std::string buffer_name, yarp::dev::AudioBufferSize bufferSize)
yarp::dev::AudioBufferSize getMaxSize()
const SAMPLE * getRawData()
yarp::dev::CircularAudioBuffer< unsigned char > CircularAudioBuffer_8t
yarp::dev::CircularAudioBuffer< unsigned int > CircularAudioBuffer_32t
yarp::dev::CircularAudioBuffer< unsigned short int > CircularAudioBuffer_16t
The main, catch-all namespace for YARP.