6 #ifndef YARP_DEV_CIRCULARAUDIOBUFFER_H
7 #define YARP_DEV_CIRCULARAUDIOBUFFER_H
20 template <
typename SAMPLE>
32 return (end + 1) % maxsize.size == start;
48 end = (end + 1) % maxsize.size;
51 printf (
"ERROR: %s buffer overrun!\n", name.c_str());
52 start = (start + 1) % maxsize.size;
61 }
else if (end == start) {
64 i = maxsize.size - start + end;
73 printf (
"ERROR: %s buffer underrun!\n", name.c_str());
75 SAMPLE elem = elems[start];
76 start = (start + 1) % maxsize.size;
98 static_assert (std::is_same<unsigned char, SAMPLE>::value ||
99 std::is_same<unsigned short int, SAMPLE>::value ||
100 std::is_same<unsigned int, SAMPLE>::value,
101 "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.