SFBAudioPlayerDelegate

@protocol SFBAudioPlayerDelegate <NSObject>

Delegate methods supported by \c SFBAudioPlayer

  • Called to notify the delegate before decoding the first frame of audio

    Warning

    Do not change any properties of \c decoder

    Declaration

    Objective-C

    - (void)audioPlayer:(nonnull SFBAudioPlayer *)audioPlayer
        decodingStarted:(nonnull id<SFBPCMDecoding>)decoder;

    Parameters

    audioPlayer

    The \c SFBAudioPlayer object processing \c decoder

    decoder

    The decoder for which decoding started

  • Called to notify the delegate after decoding the final frame of audio

    Warning

    Do not change any properties of \c decoder

    Declaration

    Objective-C

    - (void)audioPlayer:(nonnull SFBAudioPlayer *)audioPlayer
        decodingComplete:(nonnull id<SFBPCMDecoding>)decoder;

    Parameters

    audioPlayer

    The \c SFBAudioPlayer object processing \c decoder

    decoder

    The decoder for which decoding is complete

  • Called to notify the delegate that decoding has been canceled

    Warning

    Do not change any properties of \c decoder

    Declaration

    Objective-C

    - (void)audioPlayer:(nonnull SFBAudioPlayer *)audioPlayer
         decodingCanceled:(nonnull id<SFBPCMDecoding>)decoder
        partiallyRendered:(BOOL)partiallyRendered;

    Parameters

    audioPlayer

    The \c SFBAudioPlayer object processing \c decoder

    decoder

    The decoder for which decoding is canceled

    partiallyRendered

    \c YES if any audio frames from \c decoder were rendered

  • Called to notify the delegate that audio will soon begin rendering

    Warning

    Do not change any properties of \c decoder

    Declaration

    Objective-C

    - (void)audioPlayer:(nonnull SFBAudioPlayer *)audioPlayer
        renderingWillStart:(nonnull id<SFBPCMDecoding>)decoder
                atHostTime:(uint64_t)hostTime;

    Parameters

    audioPlayer

    The \c SFBAudioPlayer object processing \c decoder

    decoder

    The decoder for which rendering is about to start

    hostTime

    The host time at which the first audio frame from \c decoder will reach the device

  • Called to notify the delegate when rendering the first frame of audio

    Warning

    Do not change any properties of \c decoder

    Declaration

    Objective-C

    - (void)audioPlayer:(nonnull SFBAudioPlayer *)audioPlayer
        renderingStarted:(nonnull id<SFBPCMDecoding>)decoder;

    Parameters

    audioPlayer

    The \c SFBAudioPlayer object processing decoder

    decoder

    The decoder for which rendering started

  • Called to notify the delegate when rendering the final frame of audio

    Warning

    Do not change any properties of \c decoder

    Declaration

    Objective-C

    - (void)audioPlayer:(nonnull SFBAudioPlayer *)audioPlayer
        renderingComplete:(nonnull id<SFBPCMDecoding>)decoder;

    Parameters

    audioPlayer

    The \c SFBAudioPlayer object processing \c decoder

    decoder

    The decoder for which rendering is complete

  • Called to notify the delegate when the now playing item changes

    Declaration

    Objective-C

    - (void)audioPlayerNowPlayingChanged:(nonnull SFBAudioPlayer *)audioPlayer;

    Parameters

    audioPlayer

    The \c SFBAudioPlayer object

  • Called to notify the delegate when the playback state changes

    Declaration

    Objective-C

    - (void)audioPlayerPlaybackStateChanged:(nonnull SFBAudioPlayer *)audioPlayer;

    Parameters

    audioPlayer

    The \c SFBAudioPlayer object

  • Called to notify the delegate when the configuration of the underlying \c AVAudioEngine changes

    Note

    Use this instead of listening for \c AVAudioEngineConfigurationChangeNotification

    Declaration

    Objective-C

    - (void)audioPlayerAVAudioEngineConfigurationChange:
        (nonnull SFBAudioPlayer *)audioPlayer;

    Parameters

    audioPlayer

    The \c SFBAudioPlayer object

  • Called to notify the delegate when rendering is complete for all available decoders

    Declaration

    Objective-C

    - (void)audioPlayerEndOfAudio:(nonnull SFBAudioPlayer *)audioPlayer;

    Parameters

    audioPlayer

    The \c SFBAudioPlayer object

  • Called to notify the delegate when an asynchronous error occurs

    Declaration

    Objective-C

    - (void)audioPlayer:(nonnull SFBAudioPlayer *)audioPlayer
        encounteredError:(nonnull NSError *)error;

    Parameters

    audioPlayer

    The \c SFBAudioPlayer object

    error

    The error