Languages

Menu
Sites
Language
[gear s1 (SM-R750)] html5 AudioContext is not working...

Html5 AudioContext Object is supported. but  It is not working gearS1 (SM-R750) device. (I cannot hear a sound.)

In gearS2 (SM-R730S) device, It works well. (I can hear a sound)

Both two devices to support the AudioContext object, why don't play sound gearS1 ??

 

 

ref by.

http://www.html5rocks.com/en/tutorials/webaudio/intro/?redirect_from_locale=ko

 

my test code,

function soundPlayWithArrayBuf(aSounds){

    if(!audioCtx){

        try {

            window.AudioContext = window.AudioContext || window.webkitAudioContext;

        } catch (e) {

            alert(e);

        }

        audioCtx = new window.AudioContext();

        if(!audioCtx)return;

    }

    

    var sndArray = new Array();

    for (var i = 0x00, len = aSounds.length; i < len; i++) {

        sndArray.push(new Promise(function(resolve, reject){

            var xmlhttp = new XMLHttpRequest();

            xmlhttp.responseType = 'arraybuffer'

            xmlhttp.onreadystatechange = function(){

                if(xmlhttp.readyState == 4 && xmlhttp.status == 200){

                    var result = xmlhttp.response;

                    resolve(result);

                    xmlhttp = null;

                }

            }

            var aURL = SND_PATH+".mp3";

            xmlhttp.open('GET', aURL, true);

            xmlhttp.timeout = 10000;

            xmlhttp.ontimeout = function() {

                xmlhttp.abort();

                reject(null);

                xmlhttp = null;

            };

            xmlhttp.send();

        }));

    }

    Promise.all(sndArray).then(function(sounds){

            for(var i = 0; i < sounds.length; i++){

                audioCtx.decodeAudioData(sounds[i], function(buf){

                    var source = audioCtx.createBufferSource();

                    source.buffer = buf;

                    source.connect(audioCtx.destination);

                    source.start(0);

                });

            }

        },

        function(e){

            alert(e);

        }

    );

}

 

Edited by: 조 현기 on 28 Apr, 2016

Responses

1 Replies
Nafisul Islam Kiron

Hello, please check

https://developer.tizen.org/development/tutorials/web-application/w3chtml5supplementary-features/media/html5-video-and-audio-element

https://developer.tizen.org/community/tip-tech/advanced-web-audio-api-usage