mirror of
https://github.com/mimamch/wa-multi-session.git
synced 2026-04-25 00:36:08 +03:00
[GH-ISSUE #39] how can I capture voice audios #32
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @aledc7 on GitHub (Aug 22, 2024).
Original GitHub issue: https://github.com/mimamch/wa-multi-session/issues/39
How can I capture the voice audio of users?
In the docs we have: but nothing about capture audio.
how can we archive that?
Thank you
@Reda-l commented on GitHub (Jan 26, 2025):
Hi! Did you manage to figure this out?
If not, I was able to achieve it using whiskeysockets/baileys. Here's a snippet of my implementation that captures and processes voice audio from users and saves it locally:
`import { downloadMediaMessage } from '@whiskeysockets/baileys';
import * as fs from 'fs';
import * as path from 'path';
private async handleAudioMessage(msg: any, sessionId: string): Promise {
try {
const audioDir = path.join('media_downloads', sessionId, 'audio');
fs.mkdirSync(audioDir, { recursive: true });
} catch (error) {
console.error('❌ Error handling audio message:', error);
throw new Error(
Failed to process audio message: ${error.message});}
}`
Good luck! ✌️
@aledc7 commented on GitHub (Jan 26, 2025):
Thank you very much, just like you, I have managed to send audios by switching to the Baileys library. Greetings!