SID Author: ... Preferred SID-model: 0, using: SID Title: ... SID release info: ... |
Start at $Hex |
(No Flash-player or Java-VM, JavaScript.)
Web Audio API is supported (and contained) by browsers (according to Wikipedia) since these versions:
Buffersize values that make sense: 1024/2048/4096/8192/16384, maximal 16384 advised at 44100Hz and above.
Then (as jsSID object called 'SIDplayer' is created) you can use its subfunctions/methods:
Web Audio API is supported (and contained) by browsers (according to Wikipedia) since these versions:
- Firefox 23+
- Chrome 10+
- Opera 15+
- Safari 6+
- M$ Edge 12
- Chrome for Android 28
- Mobile Safari 6 (restricted)
- Mobile Firefox 23
- Tizen
The player supports simple Vsync/CIA timed SIDs. SIDs with custom player and digis are not fully implemented.
To include jsSID at your page, 'jsSID.js' should be included in body/header of your HTML code:
<script type="text/javascript" src="jsSID.js"></script>
Examples
Let's see some examples (HTML buttons that handle various aspects of jsSID):Simple way
If you just want to simply play a SID without manually creating and initializing a JS object:
(This creates a jsSID object called 'SIDplayer' automatically behind the scene, so you can use its functions.)
playSID('URL', subtune);
A bit more expert way
If you want to create a SIDplayer object manually before using its functions:
SIDplayer = new jsSID(buffersize, background_noise); //background noise around 0.0005 is suitableSamplerate is inherited from the web-browser, usually 44100Hz.
Buffersize values that make sense: 1024/2048/4096/8192/16384, maximal 16384 advised at 44100Hz and above.
Then (as jsSID object called 'SIDplayer' is created) you can use its subfunctions/methods:
Choose file:
or type local URL:
SIDplayer.loadstart('URL', subtune);
SIDplayer.loadinit('URL', subtune);
Controls
In JavaScript:
SIDplayer.start(subtune);
SIDplayer.playcont();
SIDplayer.pause();
SIDplayer.stop();
In JavaScript:
SIDplayer.setvolume(volume);
SIDplayer.getoutput(); //volume range: 0..1
SIDplayer.gettitle();
SIDplayer.getauthor();
SIDplayer.getinfo();
SIDplayer.getsubtunes();
SIDplayer.getprefmodel();
SIDplayer.getplaytime();
//'playtime' is in seconds
SID-model for playback: SIDplayer.getmodel();
SIDplayer.setmodel(model);
//models: 8580.0 or 6581.0
Set callback functions (e.g. displaying SID-file info) for jsSID events:
SIDplayer.setloadcallback(function_name);
SIDplayer.setstartcallback(fn);
SIDplayer.setendcallback(fn,playtime); //in seconds
A simple playlist player can be found in this folder: playlist.html
You can also hear jsSID in action at: http://hermit.sidrip.com