AEAudioPasteboard.h
Go to the documentation of this file.
1 //
2 // AEAudioPasteboard.h
3 // TheAmazingAudioEngine
4 //
5 // Created by Michael Tyson on 23/08/2016.
6 // Copyright © 2016 A Tasty Pixel. All rights reserved.
7 //
8 
9 #import "AETypes.h"
10 
11 extern NSString * const AEAudioPasteboardInfoNumberOfChannelsKey;
12 extern NSString * const AEAudioPasteboardInfoLengthInFramesKey;
13 extern NSString * const AEAudioPasteboardInfoDurationInSecondsKey;
14 extern NSString * const AEAudioPasteboardInfoSampleRateKey;
15 extern NSString * const AEAudioPasteboardInfoSizeInBytesKey;
16 
23 extern NSString * const AEAudioPasteboardChangedNotification;
24 
25 extern NSString * const AEAudioPasteboardErrorDomain;
26 
27 enum {
29 };
30 
38 typedef void (^AEAudioPasteboardGeneratorBlock)(AudioBufferList * buffer, UInt32 * ioFrames, BOOL * finished);
39 
41 
47 @interface AEAudioPasteboard : NSObject
48 
54 + (NSDictionary *)infoForGeneralPasteboardItem;
55 
67 + (void)pasteToFileAtPath:(NSString *)path fileType:(AEAudioFileType)fileType sampleRate:(double)sampleRate
68  channelCount:(int)channelCount completionBlock:(void (^)(NSError * errorOrNil))completionBlock;
69 
78 + (void)copyFromFileAtPath:(NSString *)path completionBlock:(void (^)(NSError * errorOrNil))completionBlock;
79 
89 + (void)copyUsingGenerator:(AEAudioPasteboardGeneratorBlock)generator
90  audioDescription:(AudioStreamBasicDescription)audioDescription
91  completionBlock:(void (^)(NSError * errorOrNil))completionBlock;
92 
93 @end
94 
100 @interface AEAudioPasteboardReader : NSObject
101 
105 + (instancetype)readerForGeneralPasteboardItem;
106 
116 - (void)readIntoBuffer:(AudioBufferList *)buffer length:(UInt32 *)ioFrames;
117 
121 - (void)reset;
122 
124 @property (nonatomic) AudioStreamBasicDescription clientFormat;
125 
127 @property (nonatomic, readonly) AudioStreamBasicDescription originalFormat;
128 
129 @end