AsoundingReference

ASNSource

Inherits fromNSObject
Declared inASNSource.h
Part ofAsounding Audio Engine

Overview

A sound source capable of emitting sounds.

Discussion

Each source is capable of playing one sound at a time. To play a sound, you set sound property to the ASNSound object you want, then control the playback with the play, pause, stop and rewind methods.

Tasks

Creating a Source

- init
Initialize a new sound source.

Controlling Sound Playback

isPlaying property
The plaing state for this source.
looping property
The looping state for this source.
- pause
Start playing current sound; keeping current position for next
- play
Start playing current sound.
- rewind
Set the current position back to the start of the sound.
sound property
The sound to play from this source.
- stop
Stop playing current sound; rewinding at the start of the sound.

Properties

isPlaying

The plaing state for this source.

@property BOOL isPlaying

Discussion

This property is true while the source is playing a sound.

looping

The looping state for this source.

@property BOOL looping

Discussion

When this property is set to true, the sound will restart as soon it reaches the end.

sound

The sound to play from this source.

@property(retain) ASNSound *sound

Discussion

This is the sound that will play when calling the various playback methods on this source.

Setting the sound will stop playback of this source if it is currently playing. The same ASNSound object can be used by multiple sources at the same time.

Instance Methods

init

Initialize a new sound source.

- (id)init

Discussion

After initialization, you can attatch a sound to the source and start playing it.

pause

Start playing current sound; keeping current position for next

- (void)pause

play

Start playing current sound.

- (void)play

Discussion

The sound starts playing at the current position.

rewind

Set the current position back to the start of the sound.

- (void)rewind

stop

Stop playing current sound; rewinding at the start of the sound.

- (void)stop