Memory buffer player.
More...
#import <AEMemoryBufferPlayer.h>
Inherits <NSObject>, and <AEAudioPlayable>.
Memory buffer player.
This class allows you to play a buffer containing audio, either as one-off samples, or looped. It can load any audio file format supported by iOS.
To use, create an instance, then add it to the audio controller.
+ (void) beginLoadingAudioFileAtURL: |
|
(NSURL *) |
url |
audioDescription: |
|
(AudioStreamBasicDescription) |
audioDescription |
completionBlock: |
|
(AEMemoryBufferPlayer *) |
|
|
|
(NSError *) |
completionBlock |
|
|
| |
Initialise with audio loaded from a file.
This method will asynchronously load the given audio file into memory, and create an AEMemoryBufferPlayer instance when it is finished.
- Parameters
-
url | URL to the file to load into memory |
audioDescription | The target audio description to use (usually the same as AEAudioController's) |
completionBlock | Block to call when the load operation has finished |
- (instancetype) initWithBuffer: |
|
(AudioBufferList *) |
buffer |
audioDescription: |
|
(AudioStreamBasicDescription) |
audioDescription |
freeWhenDone: |
|
(BOOL) |
freeWhenDone |
|
|
| |
Initialise with a memory buffer.
- Parameters
-
buffer | Audio buffer |
audioDescription | The description of the audio provided |
freeWhenDone | Whether to free the audio buffer when this class is deallocated |
- (void) playAtTime: |
|
(uint64_t) |
time |
|
Schedule playback for a particular time.
This causes the player to emit silence up until the given timestamp is reached. Use this method to synchronize playback with other audio generators.
Note: When you call this method, the property channelIsPlaying will be set to YES, to enable playback when the start time is reached.
- Parameters
-
time | The time, in host ticks, at which to begin playback |
- (AudioBufferList*) buffer |
|
readnonatomicassign |
- (NSTimeInterval) duration |
|
readnonatomicassign |
Length of audio, in seconds.
- (NSTimeInterval) currentTime |
|
readwritenonatomicassign |
Current playback position, in seconds.
- (AudioStreamBasicDescription) audioDescription |
|
readnonatomicassign |
Whether to loop this track.
- (BOOL) channelIsPlaying |
|
readwritenonatomicassign |
Whether the track is playing.
Whether the track is muted.
- (BOOL) removeUponFinish |
|
readwritenonatomicassign |
Whether the track automatically removes itself from the audio controller after playback completes.
- (void(^ completionBlock)()) |
|
readwritenonatomiccopy |
A block to be called when playback finishes.
- (void(^ startLoopBlock)()) |
|
readwritenonatomiccopy |
A block to be called when the loop restarts in loop mode.
The documentation for this class was generated from the following file: