SPSoundChannel Class Reference
| Inherits from | SPEventDispatcher : NSObject |
| Declared in | SPSoundChannel.h |
Overview
An SPSoundChannel represents an audio source. Use this class to control sound playback.
Sound channels are created with the method [SPSound createChannel]. They allow control over
playback (play, pause, stop) and properties as the volume or if the sound should loop.
Furthermore, it will dispatch events of type SPEventTypeCompleted when the sound
is finished.
Before releasing a channel, it is a good habit to call stop or to remove any event listeners.
Otherwise, an event may be dispatched to an object that was already released, causing a crash.
Tasks
Methods
-
– playStarts playback.
-
– stopStops playback. Sound will start from the beginning on
play. -
– pausePauses the sound. Call
playagain to continue.
Properties
-
isPlayingIndicates if the sound is currently playing.
property -
isPausedIndicates if the sound is currently paused.
property -
isStoppedIndicates if the sound was stopped.
property -
durationThe duration of the sound in seconds.
property -
volumeThe volume of the sound. Range: [0.0 - 1.0]
property -
loopIndicates if the sound should loop. Looping sounds don’t dispatch COMPLETED events.
property
Properties
duration
The duration of the sound in seconds.
@property (nonatomic, readonly) double durationDiscussion
The duration of the sound in seconds.
Declared In
SPSoundChannel.hisPaused
Indicates if the sound is currently paused.
@property (nonatomic, readonly) BOOL isPausedDiscussion
Indicates if the sound is currently paused.
Declared In
SPSoundChannel.hisPlaying
Indicates if the sound is currently playing.
@property (nonatomic, readonly) BOOL isPlayingDiscussion
Indicates if the sound is currently playing.
Declared In
SPSoundChannel.hisStopped
Indicates if the sound was stopped.
@property (nonatomic, readonly) BOOL isStoppedDiscussion
Indicates if the sound was stopped.
Declared In
SPSoundChannel.h