Instance Method

setInputGain:error:

Changes the input gain to the specified value.

Declaration

- (BOOL)setInputGain:(float)gain error:(NSError * _Nullable *)outError;

Parameters

gain

The new gain value, which must be in the range 0.0 to 1.0, where 0.0 represents the lowest gain setting and 1.0 represents the highest gain setting.

outError

On input, a pointer to an error object. If an error occurs, the pointer is set to an NSError object that describes the error. If you do not want error information, pass in nil.

Return Value

YES if the new gain value was set successfully, NO if it was not.

Discussion

Before calling this method, check the value in the inputGainSettable property to make sure the input gain level is settable for the current inputs.

See Also

Working with Audio Device Settings

inputGain

The gain applied to inputs associated with the session.

inputGainSettable

A Boolean value that indicates whether the input gain can be set.

outputVolume

The system wide output volume set by the user.

inputLatency

The latency for audio input, measured in seconds.

outputLatency

The latency for audio output, measured in seconds.

sampleRate

The current audio sample rate, in hertz.

preferredSampleRate

The preferred sample rate, in hertz.

- setPreferredSampleRate:error:

Sets the preferred sample rate for input and output.

IOBufferDuration

The current I/O buffer duration, in seconds.

preferredIOBufferDuration

The preferred I/O buffer duration, in seconds.

- setPreferredIOBufferDuration:error:

Sets the preferred audio I/O buffer duration, in seconds.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software