-
Notifications
You must be signed in to change notification settings - Fork 110
/
SDLAudioFile.h
executable file
路60 lines (46 loc) 路 1.49 KB
/
SDLAudioFile.h
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//
// SDLAudioFile.h
// SmartDeviceLink-Example
//
// Created by Joel Fischer on 10/24/17.
// Copyright 漏 2017 smartdevicelink. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface SDLAudioFile : NSObject
/**
If initialized with a file URL, the file URL it came from
*/
@property (nullable, copy, nonatomic, readonly) NSURL *inputFileURL;
/**
If initialized with a file URL, where the transcoder should produce the transcoded PCM audio file
*/
@property (nullable, copy, nonatomic, readonly) NSURL *outputFileURL;
/**
In seconds. UINT32_MAX if unknown.
*/
@property (assign, nonatomic) UInt32 estimatedDuration;
/**
The PCM audio data to be transferred and played
*/
@property (copy, nonatomic, readonly) NSData *data;
/**
The size of the PCM audio data in bytes
*/
@property (assign, nonatomic, readonly) unsigned long long fileSize;
/**
Initialize an audio file to be queued and played
@param inputURL The file that exists on the device to be transcoded and queued
@param outputURL The target URL that the transcoded file will be output to
@param duration The duration of the file
@return The audio file object
*/
- (instancetype)initWithInputFileURL:(NSURL *)inputURL outputFileURL:(NSURL *)outputURL estimatedDuration:(UInt32)duration;
/**
Initialize a buffer of PCM audio data to be queued and played
@param data The PCM audio data buffer
@return The audio file object
*/
- (instancetype)initWithData:(NSData *)data;
@end
NS_ASSUME_NONNULL_END