Class YSKManualAudioSource

An audio source that lets you control the start and end of audio recording by using the standard device input.

The YSKManualAudioSource class is thread-safe, i.e., it can be accessed from different threads. The YSKManualAudioSource object is reusable, it can start and finish the process of audio recording unlimited number of times. This only requires calling the start method again. Before starting, it requests access to read data from the device input. If the user allows access, the audio source will start and begin giving data to listeners; if the user denies access, the audio source will send the YSKErrorRecordingPermissions error in the audioSource:didFailWithError: method to the listeners. Possible error codes are listed in YSKErrorCode.
Note.
This audio source uses the standard device input, so to enable it, configure the app's audio session correctly. The YSKAudioSessionHandler class makes it easier to configure the audio session:
  • If your app uses an audio session only when working with the SpeechKit library, we recommend using this class to configure the audio session.

  • If your app uses the audio session outside the library (for audio and video playback, audio recording, and so on), you can also use this class or configure the audio session independently. If you decide to configure the audio session yourself, pay attention to the settings which may affect the operation of the audio source. They are described in the YSKAudioSessionHandler class. Unless set up properly, YSKAutoAudioSource will return the YSKManualAudioSource error in the audioSource:didFailWithError: method.

Instance Methods

-start

Starts recording audio using the standard device input.

-stop

Finishes audio recording.

Method Detail

-start

- (void)start

Starts recording audio using the standard device input.

Asynchronous execution. When the audio source is ready to transmit audio, the listeners will have the audioSourceDidStart: method called.

-stop

- (void)stop

Finishes audio recording.

Asynchronous execution. When the audio source finishes working with the audio, the listeners will have the audioSourceDidStop: method called.