HTML5 Web Audio API, porting from javax.sound and getting distortion
问题 I have a requirement to generate audio on the fly (generating from wav or mp3 files is not an option). Luckily the new WebAudio API (FF4 and Chrome 13) provides this functionality. I have some Java code i'm porting to Javascript that looks like this: byte[] buffer = new byte[]{ 56, -27, 88, -29, 88, -29, 88, -29 ............ }; AudioFormat af = new AudioFormat(44100, 16, 1, true, false); SourceDataLine sdl = AudioSystem.getSourceDataLine(af); sdl.open(af, 1470 * 4); //create 4 frame audio