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

Sounds #43

Open
AwesomestCode opened this issue Mar 2, 2021 · 5 comments
Open

Sounds #43

AwesomestCode opened this issue Mar 2, 2021 · 5 comments

Comments

@AwesomestCode
Copy link
Member

Add sounds (shouldn't be that difficult considering mineflayer has an event for hard coded sounds too)

@rom1504
Copy link
Member

rom1504 commented Mar 24, 2021

how to do it:

  1. check license

turns out a lot of MC sound effects are under CC0 Public Domain Dedication:
https://www.minecraft.net/en-us/attribution/sound/
For C418’s music, he wants attribution and a link to his download page
make sure that we filter only the sounds that we verified the licence

  1. retrieve from mojang the list of files at build time :

retrieve actual song directly in browser:

const aa = document.createElement('audio')
const ss = document.createElement('source')
ss.setAttribute('src', "http://resources.download.minecraft.net/e3/e367d1dfa1ce07374e0aeaecbfb1526142a0dcc1")
ss.setAttribute('type', 'audio/ogg')
aa.appendChild(ss)
aa.setAttribute('autoplay', "true")

bypass CORS

(reference https://github.com/PrismarineJS/node-minecraft-wrap/blob/master/lib/launcher_download.js )

@rom1504
Copy link
Member

rom1504 commented Mar 24, 2021

we'd need in addition a "event => sound that should be played mapping"
actually as said by AwesomestCode , we can use the mineflayer event for that

@rom1504
Copy link
Member

rom1504 commented Mar 25, 2021

lot of id of sounds, would need the id => file name mapping

@Moondarker
Copy link
Contributor

Most sounds would require audio spatialization (it's a nice link to have here btw), but it'd be impossible to avoid CORS policies if we use that

@kf106
Copy link
Contributor

kf106 commented Aug 12, 2022

Sound isn't playing inside the game because of this:

The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants