MicInputProvider

public class MicInputProvider

Record audio input from a microphone.

  • Whether the microphone is currently running.

    Declaration

    Swift

    public var isRunning: Bool { get }
  • The format of the PCM audio to be contained in the buffer.

    Declaration

    Swift

    public var audioFormat: AVAudioFormat?
  • Creates an instance of an MicInputProvider.

    Declaration

    Swift

    public init(inputFormat: AVAudioFormat? = nil)

    Parameters

    inputFormat

    The format of the PCM audio to be contained in the buffer.

  • Starts recording from the microphone.

    Throws

    An error of type MicInputError

    Declaration

    Swift

    public func start(tapBlock: @escaping AVAudioNodeTapBlock) throws

    Parameters

    tapBlock

    a block to be called with audio buffers

  • Starts recording from the microphone.

    Audio buffers are passed through MicInputProviderDelegate.micInputProviderDidReceive(buffer:).

    Throws

    An error of type MicInputError

    Declaration

    Swift

    public func start() throws
  • Stops recording from the microphone.

    Declaration

    Swift

    public func stop()