raksa Posted November 4, 2016 Share Posted November 4, 2016 hi i'm a newbie for phaser framework i want to know that is it possible to load audio from existing buffer or blob data to cache? for instant after i got audio buffer from input audio, i want to play it by phaser audio. because there a problem in Android browser, i can't play audio from converted dataurl via html5 audio tag. thanks, Link to comment Share on other sites More sharing options...
raksa Posted November 4, 2016 Author Share Posted November 4, 2016 i got the answer var fileReader = new FileReader(); fileReader.onload = function () { game.cache.addSound("key", "filename.wav", this.result); //and use it var audio = game.add.audio("key"); audio.play(); }; fileReader.readAsArrayBuffer(blob); Link to comment Share on other sites More sharing options...
ClywdSlade Posted September 11, 2019 Share Posted September 11, 2019 (edited) Hi... If you have to do complex operations to prepare the sound data, 23 ms may be not much. Additionally there may be some overhead to handle the DMA interrupt at the end of the transmission of each sound buffer and to manage the data cache, which is required to ensure, the sound data can be written out using DMA. Unfortunately I cannot specify, how much overhead this will take, without doing complex measurements, but I guess it will be not more than a few milliseconds. printed circuit board Edited November 13, 2019 by ClywdSlade Link to comment Share on other sites More sharing options...
Recommended Posts