0
votes

When I try this simple source code :

<body>
  <audio controls src="http://webaudioapi.com/samples/audio-tag/chrono.mp3"></audio>

  <script>
    window.AudioContext = window.AudioContext || window.webkitAudioContext;
    context = new AudioContext();

     var mediaElement   = document.querySelector('audio'),
         sourceMediaTag = context.createMediaElementSource(mediaElement);

    sourceMediaTag.connect(context.destination);

    mediaElement.play();
  </script>
</body>

The player starts but I haven't sound with Chrome 42 (it's ok with Chrome 41). I also tried with an audio gain between the source and the destination, but nothing change.

Someone knows what happens ?

1
The audio resource probably does not have the required access-control headers. - idbehold
I also tried this with the file in the same directory (<audio controls src="chrono.mp3">) and this is the same problem :( - Juliuss
If you've placed the file in the same directory and it's not working, then it's a bug in Chrome 42. File a bug with a repo case. - Raymond Toy

1 Answers

0
votes

According to this post I have to set a CORS policy in the media server AND set a "crossOrigin" parameter in the media (audio or video) markup.

Thanks for your help !