@wppconnect-team/wppconnect - v2.4.0
    Preparing search index...

    The Node.js SDK re-exports the WAJS namespace for TypeScript. This reference describes types from WA-JS 4.8.0. For operations available on a connected Node.js client, see Whatsapp. For functions running inside WhatsApp Web, see the WA-JS browser API.

    Function enableAudioInjection

    • Replace the microphone with a virtual one fed by playAudio and pushAudio. While nothing is playing it sends silence.

      Applies to one call; re-enable it for another call. Disabling stops queued audio and releases owned tracks, hooks and audio contexts.

      Enable it before the call starts: WhatsApp gets the microphone when the call is placed or accepted.

      The page must be allowed to play audio without a user gesture, for example by launching Chrome with --autoplay-policy=no-user-gesture-required.

      Parameters

      • Optionalenabled: boolean

      Returns void

      WPP.call.enableAudioInjection();
      await WPP.call.offer('[number]@c.us');