32 namespace cinder {
namespace audio {
126 virtual void start()
override;
127 virtual void stop()
override;
VoiceCallbackProcessor(const CallbackProcessorFn &callbackFn, const Options &options)
Definition: Voice.cpp:283
std::shared_ptr< class VoiceSamplePlayerNode > VoiceSamplePlayerNodeRef
Definition: Voice.h:35
friend class MixerImpl
Definition: Voice.h:111
Concrete Voice for sample playback.
Definition: Voice.h:119
virtual ~Voice()
Definition: Voice.cpp:199
std::shared_ptr< class SourceFile > SourceFileRef
Definition: Source.h:34
SamplePlayerNodeRef mNode
Definition: Voice.h:131
bool mConnectToMaster
Definition: Voice.h:77
float getPan() const
Definition: Voice.cpp:209
virtual NodeRef getInputNode() const =0
Returns the Node that is the source of this Voice's audio production. The Node type is determined by ...
virtual void stop() override
Stops the Voice, resetting its state to the same as when it was created.
Definition: Voice.cpp:274
size_t mChannels
Definition: Voice.h:76
CallbackProcessorNodeRef mNode
Definition: Voice.h:144
NodeRef getInputNode() const override
Returns the Node that is the source of this Voice's audio production. The Node type is determined by ...
Definition: Voice.h:122
std::shared_ptr< class CallbackProcessorNode > CallbackProcessorNodeRef
Definition: InputNode.h:34
Options & connectToMaster(bool shouldConnect)
Sets whether the Voice's output is automatically connected to master()->getOutput().
Definition: Voice.h:66
size_t mMaxFramesForBufferPlayback
Definition: Voice.h:76
Voice()
Definition: Voice.h:107
void setVolume(float volume)
Definition: Voice.cpp:214
virtual bool isPlaying() const
Returns whether the Voice is currently playing or not.
Definition: Voice.cpp:239
Options()
Definition: Voice.h:51
float getVolume() const
Definition: Voice.cpp:204
Options & channels(size_t ch)
Sets the number of channels for the Voice.
Definition: Voice.h:56
virtual void start()
Starts the Voice. Does nothing if currently playing.
Definition: Voice.cpp:224
virtual void pause()
Pauses the Voice inits current state. start() will resume from here.
Definition: Voice.cpp:229
SamplePlayerNodeRef getSamplePlayerNode() const
Returns a shared_ptr of the owned SamplePlayerNode.
Definition: Voice.h:124
Interface for performing high-level audio playback tasks.
Definition: Voice.h:47
virtual void stop()
Stops the Voice, resetting its state to the same as when it was created.
Definition: Voice.cpp:234
bool getConnectToMaster() const
Returns whether or not the Voice will be automatically connected to master()->getOutput().
Definition: Voice.h:73
std::function< void(Buffer *, size_t)> CallbackProcessorFn
Callback used to allow simple audio processing without subclassing a Node. First parameter is the Buf...
Definition: InputNode.h:80
VoiceSamplePlayerNode(const SourceFileRef &sourceFile, const Options &options)
Definition: Voice.cpp:253
virtual void start() override
Starts the Voice. Does nothing if currently playing.
Definition: Voice.cpp:266
static VoiceSamplePlayerNodeRef create(const SourceFileRef &sourceFile, const Options &options=Options())
Creates a Voice that manages sample playback of an audio file pointed at with sourceFile.
Definition: Voice.cpp:191
virtual NodeRef getOutputNode() const
Returns the Node that is used for connected the Voice to the greater audio graph (by default...
Definition: Voice.cpp:244
Concrete Voice for processing audio with a callback function.
Definition: Voice.h:137
std::shared_ptr< class SamplePlayerNode > SamplePlayerNodeRef
Definition: SamplePlayerNode.h:36
std::shared_ptr< class Node > NodeRef
Definition: Node.h:39
Options & maxFramesForBufferPlayback(size_t frames)
Sets the maximum number of frames acceptable for a VoiceSamplePlayerNode to use in-memory buffer play...
Definition: Voice.h:61
std::shared_ptr< class Voice > VoiceRef
Definition: Voice.h:34
size_t getMaxFramesForBufferPlayback() const
Returns the configured frame allowance for buffer playback.
Definition: Voice.h:71
Optional parameters passed into Voice::create() methods.
Definition: Voice.h:50
size_t getChannels() const
Returns the number of configured channels.
Definition: Voice.h:69
NodeRef getInputNode() const override
Returns the Node that is the source of this Voice's audio production. The Node type is determined by ...
Definition: Voice.h:139
void setPan(float pos)
Definition: Voice.cpp:219