@wppconnect/wa-js - v4.7.2
    Preparing search index...

    Function playAudio

    • Play an audio file (mp3, wav, ogg/opus, ...) in the call, through the virtual microphone. Resolves when the audio finishes or is stopped.

      The page CSP may block downloading from other domains; pass the file content (ArrayBuffer, Blob or a base64 data URL) in that case.

      Parameters

      Returns Promise<void>

      WPP.call.enableAudioInjection();
      WPP.on('call.accepted', async () => {
      await WPP.call.playAudio('data:audio/mpeg;base64,...');
      await WPP.call.end();
      });