[request] Module music without WebAudio API?

Post your work in progress addons and get feedback

Post » Tue May 31, 2016 3:54 am

This corner of the internet has a way:
http://acko.net/blog/javascript-audio-s ... th-html-5/
But that's just the basics.

There also may be some older js mod players that don't use webaudio. Anyway I guess it's in the realm of possible, but unless someone makes it usable from C2 I guess this info isn't useful.
B
94
S
33
G
118
Posts: 5,396
Reputation: 75,853

Post » Tue May 31, 2016 4:22 am

cool.. I second this.. so basically a synthesis plugin...
B
100
S
33
G
16
Posts: 1,204
Reputation: 16,865

Post » Tue May 31, 2016 5:43 am

There is already a synthesis plugin here:
plugin-jsfxr_t127653
B
94
S
33
G
118
Posts: 5,396
Reputation: 75,853

Post » Tue May 31, 2016 9:15 am

R0J0hound wrote:This corner of the internet has a way:
http://acko.net/blog/javascript-audio-s ... th-html-5/
But that's just the basics.

There also may be some older js mod players that don't use webaudio. Anyway I guess it's in the realm of possible, but unless someone makes it usable from C2 I guess this info isn't useful.


Well, @Gigatron is our module genius, but his implementations all use webaudio, like you say, it seems possible, @R0J0hound but I'm totally (as you'd imagine) useless with proper code, so I haven't a clue how to implement such a thing. Maybe it would be possible to take Protracker https://www.scirra.com/forum/plugin-protracker_t129409?&start=40&hilit=MOD or something, and convert the webaudio parts to javascript and just send the output to html5 or something?
B
41
S
12
G
14
Posts: 1,122
Reputation: 11,282

Post » Tue May 31, 2016 3:57 pm

Well if a javascript library that doesn't use webaudio can be found, then maybe that can be used. Or you could just convert your mod files to ogg files with some other software perhaps.
B
94
S
33
G
118
Posts: 5,396
Reputation: 75,853

Post » Tue May 31, 2016 5:28 pm

R0J0hound wrote:Well if a javascript library that doesn't use webaudio can be found, then maybe that can be used. Or you could just convert your mod files to ogg files with some other software perhaps.

I will have to for now (convert to ogg), unfortunately, I'd like to know if it's possible to process module files without webaudio? Since the only bit that's really important to the listener is the output, couldn't the rest of the work be done without webaudio?
B
41
S
12
G
14
Posts: 1,122
Reputation: 11,282

Post » Tue May 31, 2016 6:13 pm

Sure it's possible. The simple overview of a mod player is it takes the file and generates sound as it goes, a chunk at a time. Without webaudio it does this by creating a wav file that is then loaded and played. The issue is to make one chunk match the other precisely. Webaudio allows you to buffer sounds to be played seamlessly, as well as eliminating the the overhead of creating/loading the sound files by instead letting you write sound data directly. Of course the nitty gritty of it takes a lot more than that and some specific knowledge, not to mention a lot of time to make and optimize. Using an existing js library is dependent on if one can be found and devising a way to use from C2, which is a time consuming task in and of itself.

Converting to ogg is the fastest solution and gives the best performance since sound doesn't need to be generated.
B
94
S
33
G
118
Posts: 5,396
Reputation: 75,853

Post » Tue May 31, 2016 6:53 pm

I agree with our loveable hound. I use to have some problem then I used Adobe Audio to convert OGG
B
257
S
43
G
15
Posts: 1,992
Reputation: 41,535

Post » Tue May 31, 2016 7:05 pm

R0J0hound wrote:Sure it's possible. The simple overview of a mod player is it takes the file and generates sound as it goes, a chunk at a time. Without webaudio it does this by creating a wav file that is then loaded and played. The issue is to make one chunk match the other precisely. Webaudio allows you to buffer sounds to be played seamlessly, as well as eliminating the the overhead of creating/loading the sound files by instead letting you write sound data directly. Of course the nitty gritty of it takes a lot more than that and some specific knowledge, not to mention a lot of time to make and optimize. Using an existing js library is dependent on if one can be found and devising a way to use from C2, which is a time consuming task in and of itself.

Converting to ogg is the fastest solution and gives the best performance since sound doesn't need to be generated.

Ah, so you can't process the mod in realtime without webaudio? The reason I ask is the purpose for using mods is to adjust the speed of playback dynamically throughout the game (and to minimise filesize, but that's irrelevant), are you saying without webaudio, the module would have to be processed offline by the javascript library and then played back as a wav? Or could it still playback the module whilst being able to adjust the playback speed of the module in realtime by just playing a raw audio output, all without webaudio?
B
41
S
12
G
14
Posts: 1,122
Reputation: 11,282

Post » Tue May 31, 2016 7:58 pm

Well, either let you generate sound. Webaudio by letting you set the sound data directly and normal html5 audio by creating a wav file data URL to load and play. So both would work in my mind, however all over the net those that have actually made mod players cite normal html5 audio as tricky to precisely align one chunk to another. That isn't my expertise so I can only go by what I read. It doesn't mean they aren't wrong though.

So I'd say it's fully possible. Of course getting that possibility to something usable will take work.
B
94
S
33
G
118
Posts: 5,396
Reputation: 75,853

PreviousNext

Return to Work in Progress Addons

Who is online

Users browsing this forum: No registered users and 2 guests