Skip to content

VoiceRecorder

Facade of the Das-Peak audio recorder & processing for the UI.

Properties

public static let STOPPED = 0

Stopped state.

public static let RECORDING = 1

Recording state.

public var isRecording: Bool

True if it is recording, false otherwise.

public var version: String

Version of the SDK.

Public Methods

public init()

Constructor of the class.

Creates a VoiceRecorder with a default initial config.

public func getConfig() -> Config

Gets the config of the voice recorder.

  • Returns:

    The current configuration of the recorder.

public func setListener(_ listener: VoiceRecorderListener?)

Aggregates a UI listener to the recorder. Subclassing a VoiceRecorderAdapter class is a good candidate as listener.

  • Parameters:

    • listener: listener that will implement the methods.
public func start()

Starts the recording.

public func stop()

Stops the recording.

public func setConfig(_ config: Config)

Changes the configuration of the recorder.

  • Parameters:

    • config: configuration of the voice recorder.
public func requestAudioInfo()

Requests the AudioInfo with the status of the recording. It will be sent asynchronously to the appropriate callback in the listener.

public func requestRecordedAudio()

Requests the recorded audio so far. It will be sent asynchronously to the appropriate callback in the listener.

public func requestRecordedVoice()

Requests the recorded voice so far. It will be sent asynchronously to the appropriate callback in the listener.