How do you write an mp3 or playable file when getting voice-input from an user

let receiver = connection.receiver
let stream
receiver.speaking.on("start", userid => {
let user = client.users.cache.get(userid)
console.log(user.tag)
stream = receiver.subscribe(user.id).pipe(fs.createWriteStream(`c:/Bots/PartyMode/recordings/${user.id}.pcm`)).on("close", () => {
console.log("closed")
})
})
receiver.speaking.on("end", userid => {
receiver.voiceConnection.destroy()
stream.close()
})
let receiver = connection.receiver
let stream
receiver.speaking.on("start", userid => {
let user = client.users.cache.get(userid)
console.log(user.tag)
stream = receiver.subscribe(user.id).pipe(fs.createWriteStream(`c:/Bots/PartyMode/recordings/${user.id}.pcm`)).on("close", () => {
console.log("closed")
})
})
receiver.speaking.on("end", userid => {
receiver.voiceConnection.destroy()
stream.close()
})
Got this code and I get a pcm file but its not playable and if I import it into Audactiy, it's only a short white noise. Anyone familiar with receiving voice?
1 Reply
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server