SFBAudioFile
@interface SFBAudioFile : NSObject
An audio file containing properties (like channel count and sample rate) and metadata (like artist name and album title)
-
Returns an array containing the supported file extensions
Declaration
Objective-C
@property (class, nonatomic, readonly) NSSet<NSString *> *_Nonnull supportedPathExtensions;
-
Returns an array containing the supported MIME types
Declaration
Objective-C
@property (class, nonatomic, readonly) NSSet<NSString *> *_Nonnull supportedMIMETypes;
-
Tests whether a file extension is supported
Declaration
Objective-C
+ (BOOL)handlesPathsWithExtension:(nonnull NSString *)extension;
-
Tests whether a MIME type is supported
Declaration
Objective-C
+ (BOOL)handlesMIMEType:(nonnull NSString *)mimeType;
-
Reads metadata from \c sourceURL and writes it to \c destinationURL
Declaration
Objective-C
+ (BOOL)copyMetadataFromURL:(nonnull NSURL *)sourceURL toURL:(nonnull NSURL *)destinationURL error:(NSError *_Nullable *_Nullable)error;
Parameters
sourceURL
The source URL
destinationURL
The destination URL
error
An optional pointer to an \c NSError object to receive error information
Return Value
\c YES on success, \c NO if metadata couldn’t be read or written
-
Returns an initialized \c SFBAudioFile object for the specified URL populated with audio properties and metadata or \c nil on failure
Declaration
Objective-C
+ (nullable instancetype)audioFileWithURL:(nonnull NSURL *)url error:(NSError *_Nullable *_Nullable)error;
Parameters
url
The URL
error
An optional pointer to an \c NSError object to receive error information
Return Value
An \c SFBAudioFile object or \c nil on failure
-
Unavailable
Undocumented
Declaration
Objective-C
+ (instancetype)new NS_UNAVAILABLE;
-
Unavailable
Undocumented
Declaration
Objective-C
- (instancetype)init NS_UNAVAILABLE;
-
Returns an initialized \c SFBAudioFile object for the given URL or \c nil on failure
Note
Does not read audio properties or metadataDeclaration
Objective-C
- (nullable instancetype)initWithURL:(nonnull NSURL *)url;
Parameters
url
The URL
-
Returns an initialized \c SFBAudioFile object for the given URL or \c nil on failure
Note
Does not read audio properties or metadataDeclaration
Objective-C
- (nullable instancetype)initWithURL:(nonnull NSURL *)url error:(NSError *_Nullable *_Nullable)error;
Parameters
url
The URL
error
An optional pointer to a \c NSError to receive error information
Return Value
An initialized \c SFBAudioFile object for the specified URL, or \c nil on failure
-
Returns an initialized \c SFBAudioFile object for the given URL or \c nil on failure
Declaration
Objective-C
- (nullable instancetype)initWithURL:(nonnull NSURL *)url mimeType:(nullable NSString *)mimeType error:(NSError *_Nullable *_Nullable)error;
Parameters
url
The URL
mimeType
The MIME type of \c url or \c nil
error
An optional pointer to a \c NSError to receive error information
Return Value
An initialized \c SFBAudioFile object for the specified URL, or \c nil on failure
-
Returns an initialized \c SFBAudioFile object for the specified URL
Note
Does not read audio properties or metadataDeclaration
Objective-C
- (nullable instancetype)initWithURL:(nonnull NSURL *)url formatName:(nonnull SFBAudioFileFormatName)formatName;
Parameters
url
The URL
formatName
The name of the format to use
-
Returns an initialized \c SFBAudioFile object for the specified URL
Note
Does not read audio properties or metadataDeclaration
Objective-C
- (nullable instancetype)initWithURL:(nonnull NSURL *)url formatName:(nonnull SFBAudioFileFormatName)formatName error:(NSError *_Nullable *_Nullable)error;
Parameters
url
The URL
formatName
The name of the format to use
error
An optional pointer to a \c NSError to receive error information
-
The URL of the file
Declaration
Objective-C
@property (nonatomic, readonly) NSURL *_Nonnull url;
-
The file’s audio properties
Declaration
Objective-C
@property (nonatomic, readonly) SFBAudioProperties *_Nonnull properties;
-
The file’s audio metadata
Declaration
Objective-C
@property (nonatomic) SFBAudioMetadata *_Nonnull metadata;
-
Reads audio properties and metadata
Declaration
Objective-C
- (BOOL)readPropertiesAndMetadataReturningError: (NSError *_Nullable *_Nullable)error;
Parameters
error
An optional pointer to an \c NSError object to receive error information
Return Value
\c YES if successful, \c NO otherwise
-
Writes metadata
Declaration
Objective-C
- (BOOL)writeMetadataReturningError:(NSError *_Nullable *_Nullable)error;
Parameters
error
An optional pointer to an \c NSError object to receive error information
Return Value
\c YES if successful, \c NO otherwise