startSimulatedMicrophone

Set simulated microphone.

If sound is null, reading the real microphone resumes and the played sound is stopped.

If sound is not null, the microphone signal is replaced by sound from the provided stream and the microphone is no longer read. The sound is played in an infinite loop unless playOnce is true. This is used e.g. when the call is interrupted by a GSM call.

If playOnce is true, the Observer will be notified when the playback is done.

If there is already a simulated microphone, it is stopped before the new is started. The onSimulatedMicrophoneStopped callback is not triggered in that case.

Parameters

sound

Stream with the sound. Should support mark. FileInputStream is supported even without mark.

playOnce

Whether to play only once.

See also

to stop the simulated microphone.


Set simulated microphone.

If sound is null, reading the real microphone resumes and the played sound is stopped.

If sound is not null, the microphone signal is replaced by sound from the provided stream and the microphone is no longer read. The sound is played in an infinite loop. This is used e.g. when the call is interrupted by a GSM call.

If there is already a simulated microphone, it is stopped before the new is started. The onSimulatedMicrophoneStopped callback is not triggered in that case.

Parameters

sound

Stream with the sound. Should support mark. FileInputStream is supported even without mark.

See also

to stop the simulated microphone.