@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 pushAudio

    • Stream PCM audio to the call, for audio generated on the fly (TTS, voice bots, audio coming from Node.js). Chunks are queued and played back to back.

      Accepts a Float32Array (-1 to 1), an Int16Array or a base64 string of little-endian Int16 PCM.

      Returns the seconds of audio still queued.

      Parameters

      • samples: string | Int16Array<ArrayBufferLike> | Float32Array<ArrayBufferLike>
      • Optionaloptions: PushAudioOptions

      Returns number

      WPP.call.enableAudioInjection();
      // From Node.js, for example with puppeteer:
      await page.evaluate((chunk) => WPP.call.pushAudio(chunk), base64Pcm16k);