Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / chrome / test / data / webrtc / webaudio.js
index 686e4d2..a14f5eb 100644 (file)
@@ -8,7 +8,7 @@ var gContext = null;
 
 function loadAudioAndAddToPeerConnection(url, peerconnection) {
   if (gContext == null)
-    gContext = new webkitAudioContext();
+    gContext = new AudioContext();
 
   var inputSink = gContext.createMediaStreamDestination();
   peerconnection.addStream(inputSink.stream);
@@ -46,8 +46,10 @@ function loadAudioBuffer_(url, callback) {
   request.responseType = 'arraybuffer';
 
   request.onload = function() {
-    voiceSoundBuffer = gContext.createBuffer(request.response, false);
-    callback(voiceSoundBuffer);
+    gContext.decodeAudioData(request.response, function (decodedAudio) {
+          voiceSoundBuffer = decodedAudio;
+          callback(voiceSoundBuffer);
+        });
   }
   request.send();
 }