Skip to content

Latest commit

 

History

History
76 lines (48 loc) · 1.19 KB

AudioRecorderProtocol.md

File metadata and controls

76 lines (48 loc) · 1.19 KB

AudioRecorderProtocol

A protocol for capturing audio data from input sources (microphones).

public protocol AudioRecorderProtocol

An audio recorder is supposed to capture audio data from a microphone with a pre-configured sample rate and channel count. It should also provide the functionality for starting and stopping the capture as well as preparing the recorder and resetting it to default state

The data, errors and events should be dispatched to the delegate.

Requirements

delegate

The delegate that will receive the data, errors and events from the recorder.

var delegate: AudioRecorderDelegate?

sampleRate

The sample rate used for recording.

var sampleRate: Double

channels

The amount of channels captured by the recorder.

var channels: UInt32

start()

Starts the recorder.

func start() throws

stop()

Starts the recorder.

func stop()

suspend()

Suspends the recorder, telling it to release any resources.

func suspend() throws

resume()

Resumes the recorder, re-initialising any resources needed for audio capture.

func resume() throws