-
Notifications
You must be signed in to change notification settings - Fork 95
Expand file tree
/
Copy pathSFBPCMEncoding.h
More file actions
37 lines (27 loc) · 1.23 KB
/
SFBPCMEncoding.h
File metadata and controls
37 lines (27 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//
// SPDX-FileCopyrightText: 2020 Stephen F. Booth <contact@sbooth.dev>
// SPDX-License-Identifier: MIT
//
// Part of https://github.com/sbooth/SFBAudioEngine
//
#import <SFBAudioEngine/SFBAudioEncoding.h>
NS_ASSUME_NONNULL_BEGIN
/// Protocol defining the interface for audio encoders consuming PCM audio
NS_SWIFT_NAME(PCMEncoding)
@protocol SFBPCMEncoding <SFBAudioEncoding>
// MARK: - Position and Length Information
/// Returns the encoder's current frame position or `SFBUnknownFramePosition` if unknown
@property(nonatomic, readonly) AVAudioFramePosition framePosition NS_SWIFT_NAME(position);
// MARK: - Encoding
/// The estimated number of frames to encode or `0` if unknown
@property(nonatomic) AVAudioFramePosition estimatedFramesToEncode;
/// Encodes audio
/// - parameter buffer: A buffer containing the audio to encode
/// - parameter frameLength: The desired number of audio frames
/// - parameter error: An optional pointer to an `NSError` object to receive error information
/// - returns: `YES` on success, `NO` otherwise
- (BOOL)encodeFromBuffer:(AVAudioPCMBuffer *)buffer
frameLength:(AVAudioFrameCount)frameLength
error:(NSError **)error NS_SWIFT_NAME(encode(from:length:));
@end
NS_ASSUME_NONNULL_END