Class YSKBaseAudioSource

An abstract class of an audio source that records an audio using the standard device input.

The class is not thread-safe; the library uses its thread-safe inheritors, YSKAutoAudioSource and YSKManualAudioSource. 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 and all of its inheritors use the standard device input, so you should 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, the class will return the YSKErrorAudioRecording error in the audioSource:didFailWithError: method.

Instance Methods

-initWithSettings:

Initializes an object of the YSKBaseAudioSource class.

Properties

settings

Audio source settings.

Method Detail

-initWithSettings:

- (instancetype)initWithSettings:(YSKAudioSourceSettings *)settings 

Initializes an object of the YSKBaseAudioSource class.

This method is a designated initializer for the YSKBaseAudioSource class.
Parameters:
settings

Audio source settings.

Returns:

An object of the YSKBaseAudioSource class.