SFBPCMDecoding

@protocol SFBPCMDecoding <SFBAudioDecoding>

Protocol defining the interface for audio decoders producing PCM audio

Position and Length Information

  • Returns the decoder’s current frame position or \c SFBUnknownFramePosition if unknown

    Declaration

    Objective-C

    @property (nonatomic, readonly) AVAudioFramePosition framePosition;
  • Returns the decoder’s length in frames or \c SFBUnknownFrameLength if unknown

    Declaration

    Objective-C

    @property (nonatomic, readonly) AVAudioFramePosition frameLength;

Decoding

  • Decodes audio

    Declaration

    Objective-C

    - (BOOL)decodeIntoBuffer:(nonnull AVAudioPCMBuffer *)buffer
                 frameLength:(AVAudioFrameCount)frameLength
                       error:(NSError *_Nullable *_Nullable)error;

    Parameters

    buffer

    A buffer to receive the decoded audio

    frameLength

    The desired number of audio frames

    error

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

    Return Value

    \c YES on success, \c NO otherwise

Seeking

  • Seeks to the specified frame

    Declaration

    Objective-C

    - (BOOL)seekToFrame:(AVAudioFramePosition)frame
                  error:(NSError *_Nullable *_Nullable)error;

    Parameters

    frame

    The desired frame

    error

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

    Return Value

    \c YES on success, \c NO otherwise