Inject an audio file

On an open device that has audio injection enabled, you can inject an audio file to mimic microphone reception. This is helpful when testing actions in apps that rely on audio input. Audio injection mocks the use of the microphone by using an uploaded audio file in .mp3 or .wav format and presenting it to the application as if it was read by the device microphone. The file cannot exceed 150 MB.

Limitations

Audio injection is not supported on devices with a USB-C port.

In addition, for calls, audio injection is not supported on devices running iOS 17 or later.

For calls, audio injection can also be supported through Bluetooth. This implementation is only available in hybrid clouds and only to select customers. For more information, see Bluetooth audio connectivity.

If your application allows voice control or dictation without the option to select the source of the audio input, install the .ipa file with sensor instrumentation enabled. This automatically moves the audio source from the built-in microphone to the connected audio cable (handset mic).

Instructions

To learn how to inject an audio file, watch this short video or read the instructions following the video. For automated testing, you can use the existing Inject audio command.

To inject an audio file:

  1. Open your app and activate the microphone option.

  2. On the device toolbar, click the audio icon .

  3. In the Inject audio file dialog box, select the location of your audio file: Repository (default) or Computer.

  4. Depending on your selection in step 2, do the following:

    • Repository: Search for and select the repository file you want to use.

      You can search by tag name, if applicable. If a file is associated with tags, a tag symbol appears below the file name, along with the number of tags associated with the file. To view the tag names, move the pointer over the tag icon .

    • Computer:

      1. Click ADD AUDIO.

      2. Browse to the file you want to use.

      3. Select the file and click Open.

        The file loads.

  5. Click INJECT AUDIO FILE.

    Perfecto injects the file and your app should reflect the result shortly.