IVSCustomAudioSource

Objective-C

@protocol IVSCustomAudioSource <IVSAudioDevice>

Swift

protocol IVSCustomAudioSource : IVSAudioDevice

An extention of IVSAudioDevice that allows for submitting CMSampleBuffers manually. This can be used to submit PCM audio directly to the SDK.

Note

Make sure you have an IVSMixerSlotConfiguration that requests the preferredAudioInput value of IVSDeviceTypeUserAudio.
  • Submit a frame to the broadcaster for processing.

    Declaration

    Objective-C

    - (void)onSampleBuffer:(nonnull CMSampleBufferRef)sampleBuffer;

    Swift

    func onSampleBuffer(_ sampleBuffer: CMSampleBuffer)

    Parameters

    sampleBuffer

    a sample buffer with a PCM audio data.

  • Submit raw PCM data with its sample time for processing.

    Declaration

    Objective-C

    - (void)onPCMBuffer:(nonnull AVAudioPCMBuffer *)pcmBuffer
                     at:(nonnull AVAudioTime *)audioTime;

    Swift

    func onPCMBuffer(_ pcmBuffer: AVAudioPCMBuffer, at audioTime: AVAudioTime)

    Parameters

    pcmBuffer

    A PCM audio buffer

    audioTime

    The time the PCM audio buffer was recorded