#include <cascade/av/CascadeAudioPlayer.h>
Inheritance diagram for CascadeAudioPlayer:
CascadeAudioPlayer is a class that allows easy playback of audio streams of all sources, types, and durations.
Use: CascadeStream stream; CascadeAudioPlayer player; player.PlayStream(stream);
|
|
|
represents a type of playback result PlaybackResult represents the types of playback results that can occur. A variable of this type is provided to the virtual function OnPlaybackEndDT() to indicate the result of the playback.
|
|
the default constructor - lightweight This default constructor is lightweight. |
|
destructor The destructor. |
|
attaches a custom playback device (not required) AttachDevice() may be used to attach a custom (non-default) audio playback device for use by the player. If no device is ever attached with this function, the default system playback device is used. The player must be in the stopped state for this function to succeed.
|
|
closes the audio player Close() closes the audio player. Be sure to close (or delete) the audio player when you're done with it so other clients can use it. |
|
detaches a previously attached custom playback device DetachDevice() detaches a previously attached custom playback device restoring the player to using the default audio playback device. The player must be in the stopped state for this function to succeed.
|
|
determines whether or not the audio player is open IsOpen() determines whether or not the audio player is open by this instance.
|
|
determines whether or not the file is paused IsPaused() determines whether or not the mp3 file is paused.
|
|
determines whether or not the file is playing IsPlaying() determines whether or not the mp3 file is playing.
|
|
determines whether or not the file is stopped IsStopped() determines whether or not the mp3 file is stopped.
|
|
opens the audio player Open() opens the audio player. The player must be opened succesfully before it can be used. If Open() fails, that means that another client has the audio player opened.
|
|
pauses playback Pause() puts the player into a paused state.
|
|
|
|
queues a stream for playback QueueStream() queues a stream for playback, returning a unique id for the queued stream. A major use of queueing is to queue a second stream before the first one is finished to allow seamless playback transitioning. NOTE: if the sample rate changes between streams, then a short delay will take place between streams. Once a stream has finished playing back, it is removed from the queue. and OnPlaybackComplete() is called with the completion status. From the time a stream is queued, it is owned by a distinct CascadeAudioPlayer thread and must not be used by the client outside of client notification functions until OnPlaybackEnd() is called at which point the ownership of the stream is returned to the client. The client may optionally pass in a stream type into this function. If a stream type is passed in, the codec registered for that type will be used, if any. If no codec is found registered to that type, then playback will fail and your OnAudioPlaybackEnd() function will be called to return the stream to you immediately. If NULL or "" is passed in as the type, then auto-select will be engaged and CascadeAudioPlayer will quiz all registered codecs and if it finds one that can handle the stream (based on examination of stream data), it will use it. The following values for pType are envisioned to be supported: NULL - auto select the type if possible "" - auto select the type if possible "MP3" - an MP3 stream "AAC" - an AAC stream "WAV" - an uncompressed WAV stream "AIFF" - an uncompressed AIFF stream |
|
resumes playback Resume() resumes playback of a previously paused stream
|
|
sets the playback volume SetVolume() sets the output volume of audio playback. Legal values for nVolume are 0 - 0xFFFF which is a linear range of volume where 0 is no volume and 0xFFFF is full volume.
|
|
sets the playback volume in percent, on a logarithmic scale SetVolumePercent() sets the output volume of audio playback. Legal values for nVolume are 0 - 100, where 0 is -infinity dB, 1 is -30dB, and 100 is 0dB. The values in between 1 and 100 are on a logarithmic scale to be pleasant to human hearing.
|
|
stops playback and purges all queued streams Stop() stops playback immediately and removes any queued streams from the queue. No further notification functions are called.
|
|
|