pouët.net

Go to bottom

Javascript sid player

category: code [glöplog]
 
Player example and usage:
http://swimsuitboys.com/hvsc/playsid.html

HVSC player and search engine:
http://swimsuitboys.com/hvsc/
added on the 2013-12-26 21:24:57 by sasq sasq
Seems good at least just clicking to play stuff … though it didn't work in Safari. Works fine in Chrome and Firefox on the same (OS X) system. Safari version 6.1.1 (7537.73.11)
Sorry, I don't use Mac. Can you see anything in the log?
added on the 2013-12-27 10:28:08 by sasq sasq
<3 <3 <3 !!
added on the 2013-12-27 10:31:55 by Emod Emod
examples don't work here.. links appear to do nothing.. firefox 23.0.1 on linux mint debian edition..
You need at least Firefox 25 for web audio. However I thought older versions would be supported through the older audio api. Will check later.
added on the 2013-12-27 14:34:44 by sasq sasq
Playback works fine for me in Chrome. The HVSC player doesn't handle non-ASCII characters though. Dunno if it's because of the font or if it uses the wrong character encoding.
added on the 2013-12-27 15:44:40 by mic mic
Quote:
by sasq:
Sorry, I don't use Mac. Can you see anything in the log?


When I opened the inspector after the page had loaded, this was in the console:
Code:[Error] ExitStatus: Program terminated with exit(0) exit (playsid.js, line 9402) __exit (playsid.js, line 4139) _exit (playsid.js, line 4141) eK (playsid.js, line 7812) ccallFunc (playsid.js, line 553) ccall (playsid.js, line 512) playsid_play (playsid.js, line 9442) sid_play (playsid.html, line 13) onload (playsid.html, line 30)

As a web dev, I have no idea what to make of that … unless there's some code that defines an ExitStatus class subclassing Error that was thrown with that message.

When I reloaded the page I got something more sensible in the console:
Code:[Error] TypeError: 'undefined' is not a function (evaluating 'this.hide()') close (content_start_0.js, line 1)

That doesn't copy what I think is the character number, so it says 1601 if that helps any.
sasq: doesn't work for me, safari 7.0.1 / osx 10.9.

There's a nice big clue in the console, since this is printed in big red letters:

Quote:
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (favicon.ico, line 0)


And just above that, some less useful stuff about Web Audio not being available:

Quote:
[Log] [/home/sasq/projects/grappix/playsid.cpp:81] Done cb 2 (playsid.js, line 97)
[Log] Loading system file `//c64/kernal'. (playsid.js, line 97)
[Log] C64MEM: Kernal rev #3. (playsid.js, line 97)
[Log] Loading system file `//c64/basic'. (playsid.js, line 97)
[Log] Loading system file `//c64/chargen'. (playsid.js, line 97)
[Log] Sound: Available sound devices: dummy fs dump wav voc iff aiff soundmovie (playsid.js, line 97)
[Log] Keyboard: Error - Cannot load keymap `x11_sym.vkm'. (playsid.js, line 97)
[Log] Initializing SDL audio threw an exception: "Web Audio API is not available!"! Continuing without audio. (playsid.js, line 5898)
[Log] Couldn't open audio: unknown SDL-emscripten error (playsid.js, line 100)
[Log] [/home/sasq/projects/chipmachine/src/plugins/VicePlugin/VicePlugin.cpp:161] VicePlugin destroy (playsid.js, line 97)


From what I remember, safari does support web audio but there are incompatibilities.
added on the 2013-12-27 18:33:53 by psonice psonice
Yes Safari should be supported. The relevant code that throws the exception in emscripten-SDL is this:

Code: if (!SDL.audioContext) { if (typeof(AudioContext) === 'function') { SDL.audioContext = new AudioContext(); } else if (typeof(webkitAudioContext) === 'function') { SDL.audioContext = new webkitAudioContext(); } else { throw 'Web Audio API is not available!'; } }


so even though it's supposed to be supported it fails to create an AudioContext...

@hoover: Tried in Firefox 23.0.1 and it works here (Ubuntu).
added on the 2013-12-27 20:07:49 by sasq sasq

login

Go to top