An audio source that lets you control the start and end of audio recording by using the standard device input.
YSKManualAudioSourceclass is thread-safe, i.e., it can be accessed from different threads. The
YSKManualAudioSourceobject 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
YSKErrorRecordingPermissionserror in the audioSource:didFailWithError: method to the listeners. Possible error codes are listed in YSKErrorCode.
YSKAudioSessionHandlerclass makes it easier to configure the audio session:
If your app uses an audio session only when working with the
SpeechKitlibrary, 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
YSKAudioSessionHandlerclass. Unless set up properly,
YSKAutoAudioSourcewill return the
YSKManualAudioSourceerror in the audioSource:didFailWithError: method.
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.
Finishes audio recording.Asynchronous execution. When the audio source finishes working with the audio, the listeners will have the audioSourceDidStop: method called.