Aviv
Aviv
DIAdiscord.js - Imagine an app
Created by Aviv on 6/17/2023 in #djs-voice
Listen to user vocal input using connection
have you encountered this issue?
16 replies
DIAdiscord.js - Imagine an app
Created by Aviv on 6/17/2023 in #djs-voice
Listen to user vocal input using connection
hey again. when i tried to use the prism library it stated i need to use node-crc, when i tried to installed it i got these errors:
npm i node-crc
npm ERR! code 1
npm ERR! path C:\Users\User\Desktop\Root\Development\Discord Bot\ShiraBetzibur\node_modules\node-crc
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c napi build --release --platform --js index.cjs --dts index.d.cts && node build.js
npm ERR! Type Error: Could not parse the Cargo.toml: Error: Command failed: cargo metadata --format-version 1 --manifest-path "C:\Users\User\Desktop\Root\Development\Discord Bot\ShiraBetzibur\node_modules\node-crc\Cargo.toml"
npm ERR! 'cargo' is not recognized as an internal or external command,
npm ERR! operable program or batch file.
npm ERR!
npm ERR! 'cargo' is not recognized as an internal or external command,
npm ERR! operable program or batch file.
npm ERR! at BuildCommand.<anonymous> (C:\Users\User\Desktop\Root\Development\Discord Bot\ShiraBetzibur\node_modules\@napi-rs\cli\scripts\index.js:11300:23)
npm ERR! at Generator.next (<anonymous>)
npm ERR! at C:\Users\User\Desktop\Root\Development\Discord Bot\ShiraBetzibur\node_modules\@napi-rs\cli\scripts\index.js:3512:71
npm ERR! at new Promise (<anonymous>)
npm ERR! at __awaiter$1 (C:\Users\User\Desktop\Root\Development\Discord Bot\ShiraBetzibur\node_modules\@napi-rs\cli\scripts\index.js:3508:12)
npm ERR! at BuildCommand.execute (C:\Users\User\Desktop\Root\Development\Discord Bot\ShiraBetzibur\node_modules\@napi-rs\cli\scripts\index.js:11286:16)
npm ERR! at BuildCommand.validateAndExecute (C:\Users\User\Desktop\Root\Development\Discord Bot\ShiraBetzibur\node_modules\@napi-rs\cli\scripts\index.js:2038:37)
npm ERR! at C:\Users\User\Desktop\Root\Development\Discord Bot\ShiraBetzibur\node_modules\@napi-rs\cli\scripts\index.js:3095:53
npm ERR! at noopCaptureActivator (C:\Users\User\Desktop\Root\Development\Discord Bot\ShiraBetzibur\node_modules\@napi-rs\cli\scripts\index.js:3353:12)
npm ERR! at Cli.run (C:\Users\User\Desktop\Root\Development\Discord Bot\ShiraBetzibur\node_modules\@napi-rs\cli\scripts\index.js:3095:30)

npm ERR! A complete log of this run can be found in: C:\Users\User\AppData\Local\npm-cache\_logs\2023-06-24T21_36_06_992Z-debug-0.log
npm i node-crc
npm ERR! code 1
npm ERR! path C:\Users\User\Desktop\Root\Development\Discord Bot\ShiraBetzibur\node_modules\node-crc
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c napi build --release --platform --js index.cjs --dts index.d.cts && node build.js
npm ERR! Type Error: Could not parse the Cargo.toml: Error: Command failed: cargo metadata --format-version 1 --manifest-path "C:\Users\User\Desktop\Root\Development\Discord Bot\ShiraBetzibur\node_modules\node-crc\Cargo.toml"
npm ERR! 'cargo' is not recognized as an internal or external command,
npm ERR! operable program or batch file.
npm ERR!
npm ERR! 'cargo' is not recognized as an internal or external command,
npm ERR! operable program or batch file.
npm ERR! at BuildCommand.<anonymous> (C:\Users\User\Desktop\Root\Development\Discord Bot\ShiraBetzibur\node_modules\@napi-rs\cli\scripts\index.js:11300:23)
npm ERR! at Generator.next (<anonymous>)
npm ERR! at C:\Users\User\Desktop\Root\Development\Discord Bot\ShiraBetzibur\node_modules\@napi-rs\cli\scripts\index.js:3512:71
npm ERR! at new Promise (<anonymous>)
npm ERR! at __awaiter$1 (C:\Users\User\Desktop\Root\Development\Discord Bot\ShiraBetzibur\node_modules\@napi-rs\cli\scripts\index.js:3508:12)
npm ERR! at BuildCommand.execute (C:\Users\User\Desktop\Root\Development\Discord Bot\ShiraBetzibur\node_modules\@napi-rs\cli\scripts\index.js:11286:16)
npm ERR! at BuildCommand.validateAndExecute (C:\Users\User\Desktop\Root\Development\Discord Bot\ShiraBetzibur\node_modules\@napi-rs\cli\scripts\index.js:2038:37)
npm ERR! at C:\Users\User\Desktop\Root\Development\Discord Bot\ShiraBetzibur\node_modules\@napi-rs\cli\scripts\index.js:3095:53
npm ERR! at noopCaptureActivator (C:\Users\User\Desktop\Root\Development\Discord Bot\ShiraBetzibur\node_modules\@napi-rs\cli\scripts\index.js:3353:12)
npm ERR! at Cli.run (C:\Users\User\Desktop\Root\Development\Discord Bot\ShiraBetzibur\node_modules\@napi-rs\cli\scripts\index.js:3095:30)

npm ERR! A complete log of this run can be found in: C:\Users\User\AppData\Local\npm-cache\_logs\2023-06-24T21_36_06_992Z-debug-0.log
probably stating i need cargo and rust so i installed them. my question is im using heroku and i haven't really find a way to install rust buildpack for heroku. can i dodge this maybe?
16 replies
DIAdiscord.js - Imagine an app
Created by Aviv on 6/17/2023 in #djs-voice
Listen to user vocal input using connection
FeelsBadMan
16 replies
DIAdiscord.js - Imagine an app
Created by Aviv on 6/17/2023 in #djs-voice
Listen to user vocal input using connection
do you know any other way?
16 replies
DIAdiscord.js - Imagine an app
Created by Aviv on 6/17/2023 in #djs-voice
Listen to user vocal input using connection
and good morning 🙂
16 replies
DIAdiscord.js - Imagine an app
Created by Aviv on 6/17/2023 in #djs-voice
Listen to user vocal input using connection
i think the example is deprecated as prism opus does not have oggLogicalBitStream or Opushead.. const oggStream = new prism.opus.OggLogicalBitstream({ opusHead: new prism.opus.OpusHead({ channelCount: 2, sampleRate: 48000 }), pageSizeControl: { maxPackets: 10 } });
16 replies
DIAdiscord.js - Imagine an app
Created by Aviv on 6/17/2023 in #djs-voice
Listen to user vocal input using connection
🙂
16 replies
DIAdiscord.js - Imagine an app
Created by Aviv on 6/17/2023 in #djs-voice
Listen to user vocal input using connection
oh, nice. is there an FAQ channel i can look for questions like this as i don't want to bother you too much
16 replies
DIAdiscord.js - Imagine an app
Created by Aviv on 6/17/2023 in #djs-voice
Listen to user vocal input using connection
v16.14.2
16 replies
DIAdiscord.js - Imagine an app
Created by Aviv on 6/17/2023 in #djs-voice
Listen to user vocal input using connection
do you maybe know why this is happening? 'errored' friend from the stream object: errored: Error [ERR_STREAM_PUSH_AFTER_EOF]: stream.push() after EOF at new NodeError (node:internal/errors:371:5) at readableAddChunk (node:internal/streams/readable:277:30) at AudioReceiveStream.Readable.push (node:internal/streams/readable:228:10) at AudioReceiveStream.push (file:///C:/Users/User/Desktop/Root/Development/Discord%20Bot/ShiraBetzibur/node_modules/@discordjs/voice/dist/index.mjs:1306:18) at VoiceReceiver.onUdpMessage (file:///C:/Users/User/Desktop/Root/Development/Discord%20Bot/ShiraBetzibur/node_modules/@discordjs/voice/dist/index.mjs:1542:16) at VoiceUDPSocket.emit (node:events:526:28) at VoiceUDPSocket.onMessage (file:///C:/Users/User/Desktop/Root/Development/Discord%20Bot/ShiraBetzibur/node_modules/@discordjs/voice/dist/index.mjs:262:10) at Socket.<anonymous> (file:///C:/Users/User/Desktop/Root/Development/Discord%20Bot/ShiraBetzibur/node_modules/@discordjs/voice/dist/index.mjs:249:48) at Socket.emit (node:events:526:28) at UDP.onMessage [as onmessage] (node:dgram:922:8) { code: 'ERR_STREAM_PUSH_AFTER_EOF'
async listenToUser() {
const listener = voiceConnectionUtilities.getConnection()?.receiver;
listener?.speaking.addListener('start', (userId: string) => {
const stream = listener?.subscribe(userId, { end: { behavior: EndBehaviorType.AfterSilence, duration: 1000 } });
console.log(stream);
});
}
async listenToUser() {
const listener = voiceConnectionUtilities.getConnection()?.receiver;
listener?.speaking.addListener('start', (userId: string) => {
const stream = listener?.subscribe(userId, { end: { behavior: EndBehaviorType.AfterSilence, duration: 1000 } });
console.log(stream);
});
}
16 replies
DIAdiscord.js - Imagine an app
Created by Aviv on 6/17/2023 in #djs-voice
Listen to user vocal input using connection
thank you very much!
16 replies
DIAdiscord.js - Imagine an app
Created by Aviv on 6/17/2023 in #djs-voice
Listen to user vocal input using connection
hey, using the speaking map i've set an eventListener like this:
async listenToUser(user: User) {
const listener = voiceConnectionUtilities.getConnection()?.receiver;
listener?.speaking.addListener('start', (userId: string) => {});
}
async listenToUser(user: User) {
const listener = voiceConnectionUtilities.getConnection()?.receiver;
listener?.speaking.addListener('start', (userId: string) => {});
}
I've noticed a lot of people were using the connection.subscribe(userid) option and get data by chunks but i haven't really come around it yet. is there a way to do so without chunks, only using the voicemap? in addition, i tried looking for your advice to take example from the voice-example github repository. I could not find anything of the sort, probably missing it i searched on the main development github repository with no success.
16 replies
DIAdiscord.js - Imagine an app
Created by Aviv on 6/17/2023 in #djs-voice
Listen to user vocal input using connection
thanks boss
16 replies
DIAdiscord.js - Imagine an app
Created by Aviv on 6/16/2023 in #djs-voice
im getting the classic AudioPlayerError: aborted.
got it, thanks!
16 replies
DIAdiscord.js - Imagine an app
Created by Aviv on 6/16/2023 in #djs-voice
im getting the classic AudioPlayerError: aborted.
Ah, I see. so in a general question, can a bot play a non-AudioResource file? such as plain mp3?
16 replies
DIAdiscord.js - Imagine an app
Created by Aviv on 6/16/2023 in #djs-voice
im getting the classic AudioPlayerError: aborted.
so basically all music bots atm that work with youtube are breaking tos?
16 replies
DIAdiscord.js - Imagine an app
Created by Aviv on 6/16/2023 in #djs-voice
im getting the classic AudioPlayerError: aborted.
as obviously im new to discordjs/voice and want to stand in regulations.
16 replies
DIAdiscord.js - Imagine an app
Created by Aviv on 6/16/2023 in #djs-voice
im getting the classic AudioPlayerError: aborted.
i see. so what is the move favorable way of doing so?
16 replies
DIAdiscord.js - Imagine an app
Created by Aviv on 6/16/2023 in #djs-voice
im getting the classic AudioPlayerError: aborted.
pardon me for asking but what is the TOS violation regarding this development?
16 replies
DIAdiscord.js - Imagine an app
Created by Aviv on 6/15/2023 in #djs-voice
Weirdest bug i've encountered, probably need a discordjs/voice contributor help here.
Thanks for the response, I've actually solved it yesterday and the solution happened to be just like your solution. I noticed im giving the resource creator the path instead of the stream. That really fixed it. I guess internally the player has some resource states and once he got a good resource it won't go back to the path one or something similar. Thanks for the advice though I'll get to it right away
5 replies