Sound from local directory.
Hi, i am creating an App with React/Meteor. I installed react-sound and it works fine, when I take an Url from the Internet, for example those from the example. But actually, I wanted to play music, stored in a local directory. I tryed many diffrent absoulute and relative paths, but I always get this error:
sound0: Failed to load / invalid sound? Zero-length duration reported.
Is it event possible to play music from local directory or do i have to consider any special things? Thanks
I believe you need to have the files in the /public/ directory to reference them like this
You need to be able to serve those sounds with a server, then use that url in the Sound component.
we have no chance to use it from a local file?
You can. If open html from local file.
Could you give an example on this? How will I do
https://stackoverflow.com/questions/371875/local-file-access-with-javascript - but user should select file by hands https://developer.mozilla.org/en-US/docs/Archive/Misc_top_level/Same-origin_policy_for_file:_URIs
https://en.wikipedia.org/wiki/Same-origin_policy
I am storing my audio files in an Audio collection in mongoDB. How can I access those audio files and play them? Or is there a way to reference them as url?