AEAudioFilePlayer.h
Go to the documentation of this file.
1 //
2 // AEAudioFilePlayer.m
3 // The Amazing Audio Engine
4 //
5 // Created by Michael Tyson on 13/02/2012.
6 //
7 // Contributions by Ryan King and Jeremy Huff of Hello World Engineering, Inc on 7/15/15.
8 // Copyright (c) 2015 Hello World Engineering, Inc. All rights reserved.
9 // Contributions by Ryan Holmes
10 //
11 // This software is provided 'as-is', without any express or implied
12 // warranty. In no event will the authors be held liable for any damages
13 // arising from the use of this software.
14 //
15 // Permission is granted to anyone to use this software for any purpose,
16 // including commercial applications, and to alter it and redistribute it
17 // freely, subject to the following restrictions:
18 //
19 // 1. The origin of this software must not be misrepresented; you must not
20 // claim that you wrote the original software. If you use this software
21 // in a product, an acknowledgment in the product documentation would be
22 // appreciated but is not required.
23 //
24 // 2. Altered source versions must be plainly marked as such, and must not be
25 // misrepresented as being the original software.
26 //
27 // 3. This notice may not be removed or altered from any source distribution.
28 //
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 #import "AEAudioUnitChannel.h"
35 
46 
54 + (instancetype)audioFilePlayerWithURL:(NSURL *)url error:(NSError **)error;
55 
62 - (instancetype)initWithURL:(NSURL *)url error:(NSError **)error;
63 
76 - (void)playAtTime:(uint64_t)time;
77 
85 UInt32 AEAudioFilePlayerGetPlayhead(__unsafe_unretained AEAudioFilePlayer * filePlayer);
86 
87 @property (nonatomic, strong, readonly) NSURL *url;
88 @property (nonatomic, readonly) NSTimeInterval duration;
89 @property (nonatomic, assign) NSTimeInterval regionStartTime;
90 @property (nonatomic, assign) NSTimeInterval regionDuration;
91 @property (nonatomic, assign) NSTimeInterval currentTime;
92 @property (nonatomic, readwrite) BOOL loop;
93 @property (nonatomic, readwrite) BOOL removeUponFinish;
94 @property (nonatomic, copy) void(^completionBlock)();
95 @end
96 
97 #ifdef __cplusplus
98 }
99 #endif