Audio file player. More...
#import <AEAudioFilePlayer.h>
Inherits AEAudioUnitChannel.
Instance Methods | |
| (instancetype) | - initWithURL:error: |
| Default initialiser. | |
| (void) | - playAtTime: |
| Schedule playback for a particular time. | |
| (UInt32) | - AEAudioFilePlayerGetPlayhead |
| Get playhead position, in frames. | |
Instance Methods inherited from AEAudioUnitChannel | |
| (id) | - initWithComponentDescription: |
| Create a new Audio Unit channel. | |
| (id) | - initWithComponentDescription:preInitializeBlock: |
| Create a new Audio Unit channel, with a block to run before initialization of the unit. | |
| (AudioUnit) | - AEAudioUnitChannelGetAudioUnit |
| Retrieve audio unit reference. | |
| (double) | - getParameterValueForId: |
| Get an audio unit parameter. | |
| (void) | - setParameterValue:forId: |
| Set an audio unit parameter. | |
Instance Methods inherited from <AEAudioPlayable> | |
| (void) | - setupWithAudioController: |
| Perform setup, to prepare for playback. | |
| (void) | - teardown |
| Clean up resources. | |
Class Methods | |
| (instancetype) | + audioFilePlayerWithURL:error: |
| Create a new player instance. | |
Properties | |
| NSURL * | url |
| Original media URL. | |
| NSTimeInterval | duration |
| Length of audio file, in seconds. | |
| NSTimeInterval | regionStartTime |
| Time offset within file to begin playback. | |
| NSTimeInterval | regionDuration |
| Duration of playback within the file. | |
| NSTimeInterval | currentTime |
| Current playback position relative to the beginning of the file, in seconds. | |
| BOOL | loop |
| Whether to loop this track. | |
| BOOL | removeUponFinish |
| Whether the track automatically removes itself from the audio controller after playback completes. | |
| void(^ | completionBlock )() |
| A block to be called when playback finishes. | |
Properties inherited from AEAudioUnitChannel | |
| float | volume |
| Track volume. | |
| float | pan |
| Track pan. | |
| BOOL | channelIsPlaying |
| BOOL | channelIsMuted |
| AudioUnit | audioUnit |
| The audio unit. | |
| AUNode | audioGraphNode |
| The audio graph node. | |
Properties inherited from <AEAudioPlayable> | |
| AEAudioRenderCallback | renderCallback |
| Reference to the render callback. | |
| float | volume |
| Track volume. | |
| float | pan |
| Track pan. | |
| BOOL | channelIsPlaying |
| BOOL | channelIsMuted |
| AudioStreamBasicDescription | audioDescription |
Audio file player.
This class allows you to play audio files, either as one-off samples, or looped. It will play any audio file format supported by iOS.
To use, create an instance, then add it to the audio controller.
| + (instancetype) audioFilePlayerWithURL: | (NSURL *) | url | |
| error: | (NSError **) | error | |
Create a new player instance.
| url | URL to the file to load |
| error | If not NULL, the error on output |
| - (instancetype) initWithURL: | (NSURL *) | url | |
| error: | (NSError **) | error | |
Default initialiser.
| url | URL to the file to load |
| error | If not NULL, the error on output |
| - (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.
| time | The time, in host ticks, at which to begin playback |
| - (UInt32) AEAudioFilePlayerGetPlayhead | (__unsafe_unretained AEAudioFilePlayer *) | filePlayer |
Get playhead position, in frames.
For use on the realtime thread.
| filePlayer | The player |
|
readnonatomicstrong |
Original media URL.
|
readnonatomicassign |
Length of audio file, in seconds.
|
readwritenonatomicassign |
Time offset within file to begin playback.
|
readwritenonatomicassign |
Duration of playback within the file.
|
readwritenonatomicassign |
Current playback position relative to the beginning of the file, in seconds.
|
readwritenonatomicassign |
Whether to loop this track.
|
readwritenonatomicassign |
Whether the track automatically removes itself from the audio controller after playback completes.
|
readwritenonatomiccopy |
A block to be called when playback finishes.