forked from sbooth/SFBAudioEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSFBDSDDecoding.h
More file actions
44 lines (31 loc) · 1.66 KB
/
SFBDSDDecoding.h
File metadata and controls
44 lines (31 loc) · 1.66 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
38
39
40
41
42
43
44
//
// Copyright (c) 2014-2024 Stephen F. Booth <me@sbooth.org>
// Part of https://github.com/sbooth/SFBAudioEngine
// MIT license
//
#import <SFBAudioEngine/SFBAudioDecoding.h>
NS_ASSUME_NONNULL_BEGIN
/// Protocol defining the interface for audio encoders producing DSD audio
NS_SWIFT_NAME(DSDDecoding) @protocol SFBDSDDecoding <SFBAudioDecoding>
#pragma mark - Position and Length Information
/// Returns the decoder's current packet position or `SFBUnknownPacketPosition` if unknown
@property (nonatomic, readonly) AVAudioFramePosition packetPosition NS_SWIFT_NAME(position);
/// Returns the decoder's length in packets or `SFBUnknownPacketCount` if unknown
@property (nonatomic, readonly) AVAudioFramePosition packetCount NS_SWIFT_NAME(count);
#pragma mark - Decoding
/// Decodes audio
/// - parameter buffer: A buffer to receive the decoded audio
/// - parameter packetCount: The desired number of audio packets
/// - parameter error: An optional pointer to an `NSError` object to receive error information
/// - returns: `YES` on success, `NO` otherwise
- (BOOL)decodeIntoBuffer:(AVAudioCompressedBuffer *)buffer packetCount:(AVAudioPacketCount)packetCount error:(NSError **)error NS_SWIFT_NAME(decode(into:count:));
#pragma mark - Seeking
/// Returns `YES` if the decoder is seekable
@property (nonatomic, readonly) BOOL supportsSeeking;
/// Seeks to the specified packet
/// - parameter packet: The desired packet
/// - parameter error: An optional pointer to an `NSError` object to receive error information
/// - returns: `YES` on success, `NO` otherwise
- (BOOL)seekToPacket:(AVAudioFramePosition)packet error:(NSError **)error NS_SWIFT_NAME(seek(to:));
@end
NS_ASSUME_NONNULL_END