IVSAudioDevice
This represents an IVSDevice that provides audio samples.
-
Gets the gain for this audio device.
Declaration
Objective-C
- (float)gain;Swift
func gain() -> Float -
Sets the gain for this audio device. This will be clamped between 0 and 2. A gain of 1 means no change. A gain less than 1 will suppress, and greater than 1 will amplify.
Declaration
Objective-C
- (void)setGain:(float)gain;Swift
func setGain(_ gain: Float)Parameters
gainthe requested gain
-
Set a callback to receive audio stats for this device. This will always be invoked on the main queue.
Declaration
Objective-C
- (void)setStatsCallback:(nullable IVSAudioDeviceStatsCallback)callback;Swift
func setStatsCallback(_ callback: IVSAudioDeviceStatsCallback?)Parameters
callbackthat takes two floats: peak and rms.
-
Set a callback to receive the raw PCM audio buffers as they move through this device.
The callback fires on the audio thread for lowest latency, exactly as the audio is delivered. Implementations must return quickly and must not block, or audio glitches may occur. The callback must not call
setOnPCMBufferCallback:re-entrantly. Passnilto clear the callback.Declaration
Objective-C
- (void)setOnPCMBufferCallback: (nullable void (^)(AVAudioPCMBuffer *_Nonnull, AVAudioTime *_Nonnull))callback;Swift
func setOnPCMBufferCallback(_ callback: ((AVAudioPCMBuffer, AVAudioTime) -> Void)?)Parameters
callbackA block that receives the PCM data as an
AVAudioPCMBufferand anAVAudioTimerepresenting the presentation timestamp, monotonically increasing from the start of audio at the buffer’s sample rate.