SFBAudioDecoding

@protocol SFBAudioDecoding

Protocol defining the interface for audio decoders

Input

  • The \c SFBInputSource providing data to this decoder

    Declaration

    Objective-C

    @property (nonatomic, readonly) SFBInputSource *_Nonnull inputSource;

Audio Format Information

  • The format of the encoded audio data

    Declaration

    Objective-C

    @property (nonatomic, readonly) AVAudioFormat *_Nonnull sourceFormat;
  • The format of audio data produced by -decodeIntoBuffer:error:

    Declaration

    Objective-C

    @property (nonatomic, readonly) AVAudioFormat *_Nonnull processingFormat;
  • \c YES if decoding allows the original signal to be perfectly reconstructed

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL decodingIsLossless;

Setup and Teardown

  • Opens the decoder for reading

    Declaration

    Objective-C

    - (BOOL)openReturningError:(NSError *_Nullable *_Nullable)error;

    Parameters

    error

    An optional pointer to an \c NSError object to receive error information

    Return Value

    \c YES on success, \c NO otherwise

  • Closes the decoder

    Declaration

    Objective-C

    - (BOOL)closeReturningError:(NSError *_Nullable *_Nullable)error;

    Parameters

    error

    An optional pointer to an \c NSError object to receive error information

    Return Value

    \c YES on success, \c NO otherwise

  • Returns \c YES if the decoder is open

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL isOpen;

Decoding

  • Decodes audio

    Declaration

    Objective-C

    - (BOOL)decodeIntoBuffer:(nonnull AVAudioBuffer *)buffer
                       error:(NSError *_Nullable *_Nullable)error;

    Parameters

    buffer

    A buffer to receive the decoded audio

    error

    An optional pointer to an \c NSError object to receive error information

    Return Value

    \c YES on success, \c NO otherwise

Seeking

  • Returns \c YES if the decoder is seekable

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL supportsSeeking;