Jump to content

Loading sounds from higher level folder


DiV
 Share

Recommended Posts

What should work fine with "../" doesn't work in my case. If I put my .ogg sound effect in a folder of higher level I can't load it anymore. Trying different sound formats and styles of the relative URL didn't help. How do I solve this? I don't wanna copy the same file into every scene folder directly D:

Link to comment
Share on other sites

58 minutes ago, Deltakosh said:

Can you get the absolute URL instead of a relative one ?

I think I can, but I need it to work locally, and if I use the absolute URL sound will only play on my computer, right? Would it be safe to load the sound from base64 string? My sound effect is really short, so the code wouldn't be too long.

Link to comment
Share on other sites

Referencing Textures when the url is file:// does not work the same way across browsers.  Sounds are probably the same.  Edge seems to be the most permissive. 

I have a utility scene where you can load or record sounds from mic, then save to file.  If you pick .ts or .js format it will encode it as a BABYLON.Sound object (internally as a WebAudio channel buffer).  To keep the code smallest, you would need to have the QI extension, but I guess you could just copy the needed function.  The point is I am already do it, so yes embedded works.

audio.jpg.361ece475cac509d84e3dbc417205930.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...