SFBPCMEncoding

@protocol SFBPCMEncoding <SFBAudioEncoding>

Protocol defining the interface for audio encoders consuming PCM audio

Position and Length Information

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

    Declaration

    Objective-C

    @property (nonatomic, readonly) AVAudioFramePosition framePosition;

Encoding

  • The estimated number of frames to encode or \c 0 if unknown

    Declaration

    Objective-C

    @property (nonatomic) AVAudioFramePosition estimatedFramesToEncode;
  • Encodes audio

    Declaration

    Objective-C

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

    Parameters

    buffer

    A buffer containing the audio to encode

    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