30 namespace cinder {
namespace audio {
62 void setNumFrames(
size_t numFrames,
bool shrinkToFit =
false );
64 void setNumSeconds(
double numSeconds,
bool shrinkToFit =
false );
std::atomic< size_t > mWritePos
Definition: SampleRecorderNode.h:43
std::shared_ptr< Buffer > BufferRef
Definition: Buffer.h:293
virtual void process(Buffer *buffer) override
Override to perform audio processing on buffer.
Definition: SampleRecorderNode.cpp:182
void setNumFrames(size_t numFrames, bool shrinkToFit=false)
Sets the length of the recording buffer in frames.
Definition: SampleRecorderNode.cpp:140
virtual void initialize() override
Called before audio buffers need to be used. There is always a valid Context at this point...
Definition: SampleRecorderNode.cpp:102
size_t getWritePosition() const
Returns the current write position, which represents how many samples are currently recorded...
Definition: SampleRecorderNode.h:39
BufferRef getRecordedCopy() const
Returns a copy of the recored samples, up to the current write position.
Definition: SampleRecorderNode.cpp:156
Base Node class for recording audio samples. Inherits from NodeAudioPullable, and therefore does not ...
Definition: SampleRecorderNode.h:36
BufferDynamicRef mCopiedBuffer
Definition: SampleRecorderNode.h:92
BufferDynamic mRecorderBuffer
Definition: SampleRecorderNode.h:91
std::shared_ptr< BufferDynamic > BufferDynamicRef
Definition: Buffer.h:296
uint64_t getLastOverrun()
Returns the frame of the last buffer overrun or 0 if none since the last time this method was called...
Definition: SampleRecorderNode.cpp:175
std::shared_ptr< class SampleRecorderNode > SampleRecorderNodeRef
Definition: SampleRecorderNode.h:32
BufferRecorderNode(const Format &format=Format())
Definition: SampleRecorderNode.cpp:90
void initBuffers(size_t numFrames)
Definition: SampleRecorderNode.cpp:113
size_t getNumFrames() const
Returns the number of frames in the buffer.
Definition: Buffer.h:48
GLuint buffer
Definition: GLee.h:2065
void start()
Starts recording. Resets the write position to zero (call disable() to pause recording).
Definition: SampleRecorderNode.cpp:119
SampleRecorderNode(const Format &format=Format())
Definition: SampleRecorderNode.cpp:81
std::atomic< uint64_t > mLastOverrun
Definition: SampleRecorderNode.h:93
a Node that can be pulled without being connected to any outputs.
Definition: Node.h:242
void writeToFile(const ci::fs::path &filePath, SampleType sampleType=SampleType::INT_16)
Writes the currently recorded samples to a file at filePath.
Definition: SampleRecorderNode.cpp:166
void setNumSeconds(double numSeconds, bool shrinkToFit=false)
Sets the length of the recording buffer in seconds.
Definition: SampleRecorderNode.cpp:130
Records its inputs to a Buffer. The Buffer record size should be specified by the user (the default s...
Definition: SampleRecorderNode.h:47
GLenum GLsizei GLenum format
Definition: GLee.h:969
SampleType
Identifiers sample types. Primarily used for encoding audio at different bitrates.
Definition: SampleType.h:29
std::shared_ptr< class BufferRecorderNode > BufferRecorderNodeRef
Definition: SampleRecorderNode.h:33
size_t getNumFrames() const
Returns the length of the recording buffer in frames.
Definition: SampleRecorderNode.h:67
void stop()
Stops recording. Same as calling disable().
Definition: SampleRecorderNode.cpp:125
double getNumSeconds() const
Returns the length of the recording buffer in seconds.
Definition: SampleRecorderNode.cpp:135