
Product
Introducing Repository Access Permissions and Custom Roles
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.
golden-queen-voice-note
Advanced tools
Convert audio from URL to different qualities (voice, high quality, stereo) using FFmpeg
Convert any audio URL into a WhatsApp PTT (Push-To-Talk) voice note — powered by FFmpeg & Baileys.
npm install golden-queen-voice-note
const { VoiceNote } = require('golden-queen-voice-note');
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
);
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();
VoiceNote(url, jid, sock)| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | ✅ Yes | Public URL of the audio file to convert & send |
jid | string | ✅ Yes | WhatsApp JID of the target chat or user |
sock | object | ✅ Yes | Baileys WebSocket instance (makeWASocket(...)) |
Returns: Promise<void>
undicifluent converting to OGG at 24kHz monosendMessage| Setting | Value |
|---|---|
| Format | ogg |
| Codec | libopus |
| Channels | 1 () |
| Sample Rate | 24000 Hz |
| Mimetype | audio/ogg; |
| Tool / Library | Version |
|---|---|
| Node.js | >= 16.x |
undici | latest |
@whiskeysockets/baileys | latest |
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 failedMIT © G QUEEN OFC
FAQs
Convert audio from URL to different qualities (voice, high quality, stereo) using FFmpeg
The npm package golden-queen-voice-note receives a total of 5 weekly downloads. As such, golden-queen-voice-note popularity was classified as not popular.
We found that golden-queen-voice-note demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.

Product
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.