CRIWARE Unity Plugin Manual  Last Updated: 2024-07-12
Unity standard microphone recording
On iOS, if audio recording is performed via Unity's standard microphone input while using the CRIWARE plugin, the plugin will not be able to output any audio after that.
This is because all audio will be disabled at the start of the recording.
If you want to record from a microphone, please at first pause the audio output as shown in the sample code below.
Please be aware that the audio output will be interrupted at the beginning and the end of the recording.

  • Project settings
    Refer to " Enable Unity standard audio " and configure the project to make the Unity standard audio functions available.

  • Starting recording
    Pause the audio output from the plugin before starting the microphone input.
    Resume the audio after the recording starts if you want to output audio during recording.
    /* Pause the audio output */
    CriAtomPlugin.Pause (true);
    /* Start the microphone input */
    GetComponent<AudioSource>().clip = Microphone.Start(Microphone.devices [0], false, 10, 44100);
    /* Resume the audio output (if audio output during recording is needed) */
    CriAtomPlugin.Pause (false);

  • Finishing recording
    Resume the audio output from the plugin after the microphone input is finished.
    /* Pause the audio output (if there was output during recording) */
    CriAtomPlugin.Pause (true);
    /* Stop the microphone input */
    Microphone.End(Microphone.devices[0]);
    /* Resume the audio output */
    CriAtomPlugin.Pause(false);