🚀 Socket Launch Week Day 4:Socket MCP Adds Org Alerts, Threat Feed Review, and Package Inspection.Learn more
Sign In

golden-queen-voice-note

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

golden-queen-voice-note

Convert audio from URL to different qualities (voice, high quality, stereo) using FFmpeg

latest
npmnpm
Version
1.0.0
Version published
Weekly downloads
5
-28.57%
Maintainers
1
Weekly downloads
 
Created
Source

🎙️ Golden Queen Voice Note

npm version license downloads

Convert any audio URL into a WhatsApp PTT (Push-To-Talk) voice note — powered by FFmpeg & Baileys.

✨ Features

  • 🔄 Fetches audio from any URL and streams it directly through FFmpeg
  • 🎵 Converts to Opus format (WhatsApp compatible)
  • 📊 Auto-generates a waveform for the voice note UI
  • 📨 Sends the audio as a PTT (voice note) via Baileys socket
  • ⚡ Lightweight, async, and easy to integrate

📦 Installation

npm install golden-queen-voice-note

🚀 Usage

const { VoiceNote } = require('golden-queen-voice-note');

Basic Example

const { VoiceNote } = require('golden-queen-voice-note');

// Inside your Baileys message handler:
await VoiceNote(
  'https://example.com/audio/sample.mp3',  // 🔗 Audio URL
  message.key.remoteJid,                    // 📱 JID (chat ID)
  sock                                       // 🔌 Baileys socket instance
);

📖 Full Integration Example (with Baileys)

const { default: makeWASocket, useMultiFileAuthState } = require('@whiskeysockets/baileys');
const { VoiceNote } = require('golden-queen-voice-note');

async function startBot() {
  const { state, saveCreds } = await useMultiFileAuthState('./auth');

  const sock = makeWASocket({
    auth: state,
    printQRInTerminal: true,
  });

  sock.ev.on('creds.update', saveCreds);

  sock.ev.on('messages.upsert', async ({ messages }) => {
    const msg = messages[0];
    if (!msg.message) return;

    const jid = msg.key.remoteJid;
    const text = msg.message.conversation || '';

    // 🎙️ Send a voice note when user types !voice
    if (text === '!voice') {
      await VoiceNote(
        'https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3',
        jid,
        sock
      );
    }
  });
}

startBot();

🧩 API Reference

VoiceNote(url, jid, sock)

ParameterTypeRequiredDescription
urlstring✅ YesPublic URL of the audio file to convert & send
jidstring✅ YesWhatsApp JID of the target chat or user
sockobject✅ YesBaileys WebSocket instance (makeWASocket(...))

Returns: Promise<void>

🛠️ How It Works

  • Fetches the audio from the provided URL using undici
  • Streams it through fluent converting to OGG at 24kHz mono
  • Builds a basic waveform from audio chunk peaks (up to 64 points)
  • Sends the processed buffer as a PTT voice note via Baileys sendMessage

⚙️ FFmpeg Output Settings

SettingValue
Formatogg
Codeclibopus
Channels1 ()
Sample Rate24000 Hz
Mimetypeaudio/ogg;

❗ Requirements

Tool / LibraryVersion
Node.js>= 16.x
undicilatest
@whiskeysockets/baileyslatest

🐛 Error Handling

The function handles errors internally and logs them to the console. Common errors:

  • "Error: url, jid or sock missing" — One or more required arguments were not passed
  • "Failed to fetch audio" — The URL is unreachable or returned a non-OK response
  • "FFmpeg Error: ..." — Audio format is unsupported or stream failed

📄 License

MIT © G QUEEN OFC

Built with ❤️ by VIMAMODS | GOLDEN QUEEN OFC

Keywords

audio

FAQs

Package last updated on 27 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts