## This simple demo - developed by Elizabeth Hudnott - demonstrates how audio can ## be integrated into JS-EDEN via HTML5 ## Please not that the transformation of the audio extract from 'The Lion King' effected ## here is entirely coincidental - it was engineered on a platform with no audio output! ## first set up the audio controls to play a .wav file: myButton is Button("mybutton","ResetTo3",0,50,true); mySound is Div("mysound",0,0,0,0,""); picture is [mySound, myButton]; ################################################################################### ## NB must press Submit for the above code before entering the rest of the file: #################################################################################### ## binds the JavaScript audiofile to a JS-EDEN observable ## can then access the attributes of this JavaScript object in JS-EDEN (by abuse of JS-EDEN syntax!) ${{ declare_jse("myactualaudiojse"); ## creates a JS-EDEN observable that tracks a JavaScript value myactualaudiojse = myactualaudio; }}$; proc goplay : mybutton_clicked { myactualaudiojse.currentTime = 3; } ## For further details of HTML5 audio you can consult the urls at ## http://www.w3schools.com/tags/tag_audio.asp and http://www.w3schools.com/tags/ref_av_dom.asp