DanTheGoodman
DanTheGoodman
Explore posts from servers
DIdiscord.js - Imagine ❄
Created by DanTheGoodman on 12/30/2024 in #djs-voice
Not emitting audio received from websocket (webm opus)
ok so it seems i had to start the discord bot first, then send audio, so the header frame for the audio was sent to discord
9 replies
DIdiscord.js - Imagine ❄
Created by DanTheGoodman on 12/30/2024 in #djs-voice
Not emitting audio received from websocket (webm opus)
I tried using
const resource = createAudioResource(
"https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3",
{
inputType: StreamType.Arbitrary,
}
)
const resource = createAudioResource(
"https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3",
{
inputType: StreamType.Arbitrary,
}
)
and confirmed that does play audio, so connection is fine
9 replies
DIdiscord.js - Imagine ❄
Created by DanTheGoodman on 12/30/2024 in #djs-voice
Not emitting audio received from websocket (webm opus)
my suspicion is that the resource is not getting audio from the Readable, because it sits buffering for so long
9 replies
DIdiscord.js - Imagine ❄
Created by DanTheGoodman on 12/30/2024 in #djs-voice
Not emitting audio received from websocket (webm opus)
I can also see that the read method is only being called once, and not again when I emit the event that it should be called again according to https://nodejs.org/api/stream.html#readablereadsize
9 replies
DIdiscord.js - Imagine ❄
Created by DanTheGoodman on 12/30/2024 in #djs-voice
Not emitting audio received from websocket (webm opus)
dependencies:
[08:42:59.931] DEBUG (17160): --------------------------------------------------
Core Dependencies
- @discordjs/voice: 0.16.1
- prism-media: 1.3.5

Opus Libraries
- @discordjs/opus: 0.9.0
- opusscript: not found

Encryption Libraries
- sodium-native: 4.3.1
- sodium: not found
- libsodium-wrappers: 0.7.15
- tweetnacl: not found

FFmpeg
- version: 7.1
- libopus: yes
--------------------------------------------------
[08:42:59.931] DEBUG (17160): --------------------------------------------------
Core Dependencies
- @discordjs/voice: 0.16.1
- prism-media: 1.3.5

Opus Libraries
- @discordjs/opus: 0.9.0
- opusscript: not found

Encryption Libraries
- sodium-native: 4.3.1
- sodium: not found
- libsodium-wrappers: 0.7.15
- tweetnacl: not found

FFmpeg
- version: 7.1
- libopus: yes
--------------------------------------------------
9 replies
DIdiscord.js - Imagine ❄
Created by DanTheGoodman on 12/30/2024 in #djs-voice
Not emitting audio received from websocket (webm opus)
I can see in logs I am getting the data, and I do have the voicestates:
export const client = new Client({
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildVoiceStates],
})
export const client = new Client({
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildVoiceStates],
})
9 replies
DIdiscord.js - Imagine ❄
Created by DanTheGoodman on 12/30/2024 in #djs-voice
Not emitting audio received from websocket (webm opus)
const audioPlayer = createAudioPlayer({
behaviors: {
maxMissedFrames: 1000,
noSubscriber: NoSubscriberBehavior.Play,
},
})

const connection = joinVoiceChannel({
channelId: channel.id,
guildId: interaction.guildId!,
adapterCreator: channel.guild
.voiceAdapterCreator as DiscordGatewayAdapterCreator,
debug: true,
selfDeaf: false,
selfMute: false,
})

connection.on("stateChange", (oldState, newState) => {
logger.info(
`Connection transitioned from ${oldState.status} to ${newState.status}`
)
})

audioPlayer.on("stateChange", (oldState, newState) => {
logger.info(
`Audio player transitioned from ${oldState.status} to ${newState.status}`
)
})

let audioQueue: Buffer[] = []

const audioStream = new Readable({
read(size) {
console.log("read", size)
if (audioQueue.length > 0) {
logger.debug("sending audio data")
const chunk = audioQueue.shift()
return chunk
}
logger.debug("no audio data")
return null
},
})

emitter.on("audio", (audioData: AudioData) => {
audioQueue.push(audioData.audioBuffer)
audioStream.emit("readable", audioData.audioBuffer)
audioStream.emit("data", audioData.audioBuffer)
})

const resource = createAudioResource(audioStream, {
inputType: StreamType.WebmOpus,
inlineVolume: true,
})

audioPlayer.on("error", (error) => {
logger.error({ error }, "Error in audio player")
})

connection.on("error", (error) => {
logger.error({ error }, "Error in connection")
})

connection.subscribe(audioPlayer)

connection.on(VoiceConnectionStatus.Ready, () => {
logger.debug("Connection is ready, starting playback")
audioPlayer.play(resource)
})
const audioPlayer = createAudioPlayer({
behaviors: {
maxMissedFrames: 1000,
noSubscriber: NoSubscriberBehavior.Play,
},
})

const connection = joinVoiceChannel({
channelId: channel.id,
guildId: interaction.guildId!,
adapterCreator: channel.guild
.voiceAdapterCreator as DiscordGatewayAdapterCreator,
debug: true,
selfDeaf: false,
selfMute: false,
})

connection.on("stateChange", (oldState, newState) => {
logger.info(
`Connection transitioned from ${oldState.status} to ${newState.status}`
)
})

audioPlayer.on("stateChange", (oldState, newState) => {
logger.info(
`Audio player transitioned from ${oldState.status} to ${newState.status}`
)
})

let audioQueue: Buffer[] = []

const audioStream = new Readable({
read(size) {
console.log("read", size)
if (audioQueue.length > 0) {
logger.debug("sending audio data")
const chunk = audioQueue.shift()
return chunk
}
logger.debug("no audio data")
return null
},
})

emitter.on("audio", (audioData: AudioData) => {
audioQueue.push(audioData.audioBuffer)
audioStream.emit("readable", audioData.audioBuffer)
audioStream.emit("data", audioData.audioBuffer)
})

const resource = createAudioResource(audioStream, {
inputType: StreamType.WebmOpus,
inlineVolume: true,
})

audioPlayer.on("error", (error) => {
logger.error({ error }, "Error in audio player")
})

connection.on("error", (error) => {
logger.error({ error }, "Error in connection")
})

connection.subscribe(audioPlayer)

connection.on(VoiceConnectionStatus.Ready, () => {
logger.debug("Connection is ready, starting playback")
audioPlayer.play(resource)
})
9 replies
CDCloudflare Developers
Created by Walshy on 9/26/2024 in #workers-discussions
Workers should be fine - got anymore
even other workers with different names?
51 replies
CDCloudflare Developers
Created by Walshy on 9/26/2024 in #workers-discussions
Workers should be fine - got anymore
@Walshy | Deploying when will other services be automatically fixed? Or should I just start rdeploying everyhting? We have a fair few
51 replies
CDCloudflare Developers
Created by Walshy on 9/26/2024 in #workers-discussions
Workers should be fine - got anymore
yep, errors just went to 0 lol
51 replies
CDCloudflare Developers
Created by Walshy on 9/26/2024 in #workers-discussions
Workers should be fine - got anymore
No description
51 replies
CDCloudflare Developers
Created by Walshy on 9/26/2024 in #workers-discussions
Workers should be fine - got anymore
Is there a way I can redeploy using the same code from the dashboard? I tried just deploying the current version but i can't tell if that did a redeploy
51 replies
CDCloudflare Developers
Created by Walshy on 9/26/2024 in #workers-discussions
Workers should be fine - got anymore
ill try deploying real quick
51 replies
CDCloudflare Developers
Created by Walshy on 9/26/2024 in #workers-discussions
Workers should be fine - got anymore
even with .dev domains?
51 replies
CDCloudflare Developers
Created by Walshy on 9/26/2024 in #workers-discussions
Workers should be fine - got anymore
would a short-term fix for us be adding a custom domain?
51 replies
CDCloudflare Developers
Created by Walshy on 9/26/2024 in #workers-discussions
Workers should be fine - got anymore
I'm going to start giving heads up tweets, please let me know if there's any more info to this, since it's causing pretty major downtime for us
51 replies
CDCloudflare Developers
Created by Walshy on 9/26/2024 in #workers-discussions
Workers should be fine - got anymore
we're also getting more failures across some of our other services using workers on .dev domains as well
51 replies
CDCloudflare Developers
Created by Walshy on 9/26/2024 in #workers-discussions
Workers should be fine - got anymore
actually i 100% know, it's an empty body
51 replies
CDCloudflare Developers
Created by Walshy on 9/26/2024 in #workers-discussions
Workers should be fine - got anymore
this might be the same thing, i don't have the content length of the requests going out unfortunately, I can add that if we need
51 replies
CDCloudflare Developers
Created by Walshy on 9/26/2024 in #workers-discussions
Workers should be fine - got anymore
sometimes we don't have a body
51 replies