![]() |
Cinder
0.9.1
|
#include <Voice.h>
Inherited by cinder::audio::VoiceCallbackProcessor, and cinder::audio::VoiceSamplePlayerNode.
Classes | |
struct | Options |
Public Member Functions | |
virtual | ~Voice () |
virtual void | start () |
virtual void | stop () |
virtual void | pause () |
virtual bool | isPlaying () const |
virtual NodeRef | getInputNode () const =0 |
virtual NodeRef | getOutputNode () const |
void | setVolume (float volume) |
void | setPan (float pos) |
float | getVolume () const |
float | getPan () const |
Static Public Member Functions | |
static VoiceSamplePlayerNodeRef | create (const SourceFileRef &sourceFile, const Options &options=Options()) |
static VoiceRef | create (const CallbackProcessorFn &callbackFn, const Options &options=Options()) |
static void | clearBufferCache () |
Protected Member Functions | |
Voice () | |
Friends | |
class | MixerImpl |
Interface for performing high-level audio playback tasks.
A Voice is an abstraction of something you can hear, and as such they send audio to your computers output device. Currently supports file playback and processing audio with a callback function. Each Voice has controls for setting the volume and pan of its signal, and supports start(), stop(), and pause() functionality.
Underneath, playback is managed by a Node, which can be retrieved via the virtual getNode() method to perform more complex tasks.
|
virtual |
|
protected |
|
static |
Creates a Voice that manages sample playback of an audio file pointed at with sourceFile.
|
static |
|
static |
Clears all audio file buffers that that are cached in the Mixer.
|
virtual |
Starts the Voice. Does nothing if currently playing.
Reimplemented in cinder::audio::VoiceSamplePlayerNode.
|
virtual |
Stops the Voice, resetting its state to the same as when it was created.
Reimplemented in cinder::audio::VoiceSamplePlayerNode.
|
virtual |
|
virtual |
Returns whether the Voice is currently playing or not.
|
pure virtual |
Returns the Node that is the source of this Voice's audio production. The Node type is determined by the Voice subclassed.
Implemented in cinder::audio::VoiceCallbackProcessor, and cinder::audio::VoiceSamplePlayerNode.
|
virtual |
Returns the Node that is used for connected the Voice to the greater audio graph (by default, it is connected to Context::master()).
void cinder::audio::Voice::setVolume | ( | float | volume | ) |
void cinder::audio::Voice::setPan | ( | float | pos | ) |
float cinder::audio::Voice::getVolume | ( | ) | const |
float cinder::audio::Voice::getPan | ( | ) | const |
|
friend |