blitz-research / monkey

Blitz Research Monkey Source
226 stars 59 forks source link

Metadata for sound files in HTML5 target #44

Open devolonter opened 10 years ago

devolonter commented 10 years ago

Metadata allows to define whether file exists or not without an attempt to load it. So LoadSound and PlayMusic functions will be able to return valid values like other targets.

blitz-research commented 10 years ago

Ok, I've manually added the async sound loader code - thanks!

However, I think the LoadSample fix will break code that tries to load stuff outside of monkey://data/, eg: stuff with an 'absolute' URL so I've skipped all the audio meta data changes.

Also, I'm not sure if it's a good idea to just specify 'audio' for the meta data type for all audio. If anything, I think I'd prefer having separate meta data types for sound/music.

Doesn't make much difference here since everything is an audio() object, but I'm working on a version of mojo audio that uses the new webaudio for sounds, but old audio() for music, in which case if there was a need to reference meta data it might be nice to be able to do it 'by usage'.

devolonter commented 10 years ago

I’ve pushed fix for loading sample outside monkey://data, if you return to this pull request. I think we will have some issues with separate meta data for sound and music, because it will be difficult to define some generic file filter for it. However, I'll looking forward for your solution.