Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Play a mp3 fail #5778

Closed
TimoCoupek opened this issue Jun 8, 2021 · 13 comments · Fixed by #5402
Closed

Play a mp3 fail #5778

TimoCoupek opened this issue Jun 8, 2021 · 13 comments · Fixed by #5402

Comments

@TimoCoupek
Copy link

I've tried any tutorial there is in the world but I can't play an mp3 file every time I try this error comes up:
at Object.loader [as require] (M:*\exschool\JAWS BOT Database\node_modules\prism-media\src\util\loader.js:12:9)
at loadOpus (M:*\exschool\JAWS BOT Database\node_modules\prism-media\src\opus\Opus.js:17:17)
at new OpusStream (M:*
\exschool\JAWS BOT Database\node_modules\prism-media\src\opus\Opus.js:46:10)
at new Encoder (M:*
\exschool\JAWS BOT Database\node_modules\prism-media\src\opus\Opus.js:149:5)
at AudioPlayer.playPCMStream (M:*
\exschool\JAWS BOT Database\node_modules\discord.js\src\client\voiceplayer\BasePlayer.js:58:34)
at AudioPlayer.playUnknown (M:*
**\exschool\JAWS BOT Database\node_modules\discord.js\src\client\voiceplayer\BasePlayer.js:53:17)
at VoiceConnection.play (M:*\exschool\JAWS BOT Database\node_modules\discord.js\src\client\voice\util\PlayInterface.js:71:28)
in M:*
\exschool\JAWS BOT Database\index.js:305:32
at processTicksAndRejections (node:internal/process/task_queues:94:5)

Translated with www.DeepL.com/Translator (free version)

@amishshah
Copy link
Member

amishshah commented Jun 8, 2021

@TimoCoupek have you installed @discordjs/opus or opusscript? If so, what versions are installed?

@TimoCoupek
Copy link
Author

TimoCoupek commented Jun 8, 2021

this is the result when I try to install it
image
@amishshah

@amishshah
Copy link
Member

Could you give information about your system? E.g. what version of Windows you are running with, what your Node.js and discord.js versions are

@TimoCoupek
Copy link
Author

Windows: Windows 10 Enterprise
Node.js: v15.12.0
Discodjs: 7.6.3

@amishshah
Copy link
Member

Are you sure about that discord.js version? It's quite a few years old...

@TimoCoupek
Copy link
Author

and how do i update it because if i uninstall and re-install it i always get that version

@TimoCoupek
Copy link
Author

TimoCoupek commented Jun 8, 2021

also with this command (npm i discord.js@11.6.4) it installs me the version 7
and with npm install discord.js-v11and when I try to unitlall it remains because if I go npm discord.js --version even after uninstalling it gives me that it is version 7
@amishshah npm install discord.js-v11 with this command I noticed that it put me the folder discord-v11 but if I do npm discord -v remains always version 11

@TimoCoupek
Copy link
Author

I have tried everywhere on the internet also how to update discord.js but I can not and every time I try to re install the opus gives me the same errors

@vladfrangu
Copy link
Member

v7 (?!) and v11 of discord.js are not supported by us anymore. npm i discord.js@latest will give you the latest, supported version of d.js (at the time of writing, that is v12.5.3)

Secondly, for the build errors, please provide the full error in a text format (see: gists, hastebin, etc.). Before that, make sure you have build tools installed on your PC (although shouldn't be necessary since we have prebuilds) (you need C++ build tools and Python 3 installed for building from source)

@TimoCoupek
Copy link
Author

This are the errors when i try to install @discordjs/opus now:
npm ERR! code ETARGET
npm ERR! notarget No matching version found for discord.js@lastes.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

npm ERR! A complete log of this run can be found in:
PS C:\Users\Timo\Desktop\Jawsbot> npm install discord.js@lates
npm ERR! notarget No matching version found for discord.js@lates.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Timo\AppData\Local\npm-cache_logs\2021-06-08T15_03_47_904Z-debug.log
PS C:\Users\Timo\Desktop\Jawsbot> npm install discord.js @discordjs/opus
Terminare il processo batch (S/N)? n
PS C:\Users\Timo\Desktop\Jawsbot> npm install @discordjs/opus
npm ERR! code 1
npm ERR! path C:\Users\Timo\Desktop\Jawsbot\node_modules@discordjs\opus
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build
npm ERR! Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\Timo\Desktop\Jawsbot\node_modules@discordjs\opus\prebuild\node-v93-napi-v3-win32-x64-unknown-unknown\opus.node --module_name=opus --module_path=C:\Users\Timo\Desktop\Jawsbot\node_modules@discordjs\opus\prebuild\node-v93-napi-v3-win32-x64-unknown-unknown --napi_version=8 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@0.3.2
npm ERR! node-pre-gyp info using node@16.3.0 | win32 | x64
npm ERR! node-pre-gyp info check checked for "C:\Users\Timo\Desktop\Jawsbot\node_modules@discordjs\opus\prebuild\node-v93-napi-v3-win32-x64-unknown-unknown\opus.node" (not found)
npm ERR! node-pre-gyp http GET https://github.com/discordjs/opus/releases/download/v0.5.0/opus-v0.5.0-node-v93-napi-v3-win32-x64-unknown-unknown.tar.gz
npm ERR! node-pre-gyp ERR! install response status 404 Not Found on https://github.com/discordjs/opus/releases/download/v0.5.0/opus-v0.5.0-node-v93-napi-v3-win32-x64-unknown-unknown.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for @discordjs/opus@0.5.0 and node@16.3.0 (node-v93 ABI, unknown) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/discordjs/opus/releases/download/v0.5.0/opus-v0.5.0-node-v93-napi-v3-win32-x64-unknown-unknown.tar.gz
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@16.3.0 | win32 | x64
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@16.3.0 | win32 | x64
npm ERR! gyp info find Python using Python version 3.9.5 found at "C:\Users\Timo\AppData\Local\Programs\Python\Python39\python.exe"
npm ERR! gyp http GET https://nodejs.org/download/release/v16.3.0/node-v16.3.0-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v16.3.0/node-v16.3.0-headers.tar.gz
npm ERR! gyp http GET https://nodejs.org/download/release/v16.3.0/SHASUMS256.txt
npm ERR! gyp http GET https://nodejs.org/download/release/v16.3.0/win-x86/node.lib
npm ERR! gyp http GET https://nodejs.org/download/release/v16.3.0/win-x64/node.lib
npm ERR! gyp http GET https://nodejs.org/download/release/v16.3.0/win-arm64/node.lib
npm ERR! gyp http 200 https://nodejs.org/download/release/v16.3.0/SHASUMS256.txt
npm ERR! gyp http 200 https://nodejs.org/download/release/v16.3.0/win-x64/node.lib
npm ERR! gyp http 200 https://nodejs.org/download/release/v16.3.0/win-x86/node.lib
npm ERR! gyp http 404 https://nodejs.org/download/release/v16.3.0/win-arm64/node.lib
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp ERR! find VS checking VS2019 (16.9.31205.134) found at:
npm ERR! gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
npm ERR! gyp ERR! find VS - "Visual Studio C++ core features" missing
npm ERR! gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
npm ERR! gyp ERR! find VS looking for Visual Studio 2015
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload.
npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use
npm ERR! gyp ERR! stack at VisualStudioFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
npm ERR! gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16
npm ERR! gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
npm ERR! gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14
npm ERR! gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16
npm ERR! gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
npm ERR! gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
npm ERR! gyp ERR! stack at ChildProcess.exithandler (node:child_process:333:5)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:394:28)
npm ERR! gyp ERR! stack at maybeClose (node:internal/child_process:1067:16)
npm ERR! gyp ERR! System Windows_NT 10.0.19043
npm ERR! gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\Users\Timo\Desktop\Jawsbot\node_modules\@discordjs\opus\prebuild\node-v93-napi-v3-win32-x64-unknown-unknown\opus.node" "--module_name=opus" "--module_path=C:\Users\Timo\Desktop\Jawsbot\node_modules\@discordjs\opus\prebuild\node-v93-napi-v3-win32-x64-unknown-unknown" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3"
npm ERR! gyp ERR! cwd C:\Users\Timo\Desktop\Jawsbot\node_modules@discordjs\opus
npm ERR! gyp ERR! node -v v16.3.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok
npm ERR! node-pre-gyp ERR! build error
npm ERR! node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\Timo\Desktop\Jawsbot\node_modules@discordjs\opus\prebuild\node-v93-napi-v3-win32-x64-unknown-unknown\opus.node --module_name=opus --module_path=C:\Users\Timo\Desktop\Jawsbot\node_modules@discordjs\opus\prebuild\node-v93-napi-v3-win32-x64-unknown-unknown --napi_version=8 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
npm ERR! node-pre-gyp ERR! stack at ChildProcess. (C:\Users\Timo\Desktop\Jawsbot\node_modules@discordjs\node-pre-gyp\lib\util\compile.js:85:20)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.emit (node:events:394:28)
npm ERR! node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1067:16)
npm ERR! node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
npm ERR! node-pre-gyp ERR! System Windows_NT 10.0.19043
npm ERR! node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\Timo\Desktop\Jawsbot\node_modules\@discordjs\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd C:\Users\Timo\Desktop\Jawsbot\node_modules@discordjs\opus
npm ERR! node-pre-gyp ERR! node -v v16.3.0
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v0.3.2
npm ERR! node-pre-gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Timo\AppData\Local\npm-cache_logs\2021-06-08T15_05_32_550Z-debug.log

@SpaceEEC
Copy link
Member

SpaceEEC commented Jun 8, 2021

You seem to have misspelled latest there.

Also the error suggests that you do have VS19 installed, but are missing the "Desktop development with C++" workload(?).
You might want to try to install that and then try installing @discordjs/opus again.

@TimoCoupek
Copy link
Author

image
I have installed everything but it always gives me the same errors

@amishshah
Copy link
Member

Hi there,

We're working on a new implementation of Discord's Voice API that has better playback quality and is more reliable than what we currently support in Discord.js v12 - check it out at https://github.com/discordjs/voice!

The new library solves many of the issues that users are facing, and as part of this, we're dropping built-in support for voice in our next major release. We have a PR (#5402) that adds native support for our new voice library - once this PR is merged, this issue will be closed.

You can still use our new voice library before that PR lands - just take a look at our music bot example to see how to get started upgrading your voice code. By using the boilerplate music player in the example, you can make it even easier to upgrade your code.

Note that the PR above only reduces some of the boilerplate code you'd otherwise have to write - you do not have to wait for the PR to be merged to start using the new voice library.


If you have any questions about this, feel free to:

  • Make an issue if you have found a bug in the new voice library
  • Use GitHub Discussions or join our Discord server (we have a new channel, #djs-new-voice, specifically for this!) to ask general questions about the library, give feedback on the library, and get support with upgrading to it

@amishshah amishshah linked a pull request Jun 9, 2021 that will close this issue
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants