1import{util as utilweb}from"./util.js";import{util}from"./util_general.js";export var sound;!function(t){const e="sound";let o=null,n={};function i(t,i){if(!o)return void util.log(e,"disabled");let l=t+i;if(utilweb.isStandaloneMode()&&utilweb.isLocalPage())util.log(e,"STANDALONE: loadSound disabled");else{util.log(e,"load",l);var u=new XMLHttpRequest;u.open("GET",l,!0),u.responseType="arraybuffer",u.onload=()=>{o.decodeAudioData(u.response,t=>{n[i]=t,util.log(e,"load done",i)})},u.send()}}t.init=function(t,e){if(!o){var n=window.AudioContext||window.webkitAudioContext||!1;o=new n;for(const o of e)i(t,o)}};var l=[];function u(){if(l){for(const t of l)t.stop();l=[]}}t.stop=u;let a=1;t.setVolume=function(t){util.log(e,"set volume",t),t<0&&(t=0),t>1&&(t=1),a=t};const r=[16.352,32.703,65.406,130.81,261.63,523.25,1046.5,2093,4186,8372,16744],d=[18.354,36.708,73.416,146.83,293.66,587.33,1174.7,2349.3,4698.6,9397.3,18794.5],s=[20.602,41.203,82.407,164.81,329.63,659.26,1318.5,2637,5274,10548.1,21096.2],c=[21.827,43.654,87.307,174.61,349.23,698.46,1396.9,2793.8,5587.7,11175.3,22350.6],f=[24.5,48.999,97.999,196,392,783.99,1568,3136,6271.9,12543.9,25087.7],p=[27.5,55,110,220,440,880,1760,3520,7040,14080,28160],v=[30.868,61.735,123.47,246.94,493.88,987.77,1975.5,3951.1,7902.1,15804.3,31608.5];t.SCALE_FULL=[r,[17.324,34.648,69.296,138.59,277.18,554.37,1108.7,2217.5,4434.9,8869.8,17739.7],d,[19.445,38.891,77.782,155.56,311.13,622.25,1244.5,2489,4978,9956.1,19912.1],s,c,[23.125,46.249,92.499,185,369.99,739.99,1480,2960,5919.9,11839.8,23679.6],f,p,[29.135,58.27,116.54,233.08,466.16,932.33,1864.7,3729.3,7458.6,14917.2,29834.5],v],t.SCALE_BASE=[r,d,s,c,f,p,v],t.playNote=function(t,n,i){if(!o)return void util.log(e,"disabled");u();let r=o.createOscillator();r.type="sine",r.frequency.value=i[t][n];let d=o.createGain();d.gain.value=.6*a,d.connect(o.destination),r.connect(d),r.start(),l=[r]},t.play=function(t,i,r){if(!o)return void util.log(e,"disabled");u();var d=n[t];if(!d)return void util.log(e,"play","not found:",t);var s=o.createBufferSource();s.buffer=d;let c=o.createGain();c.gain.value=a,c.connect(o.destination),s.connect(c),s.start(0,i,r),l=[s]}}(sound||(sound={}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.