title: How to fix changing sample rate bug
body: <p>In my app after I play a video, the default sample rate is changed and the sound becomes chip-munk level.</p>
  
  <p><a href="https://stackoverflow.com/questions/17892345/webkit-audio-distorts-on-ios-6-iphone-5-first-time-after-power-cycling">This answer</a> shows very clear the problem:</p>
  
  <pre><code>// Play a video with audio encoded at 44100 Hz
  video.play();
  
  // This will console log 44100
  var ctx = new webkitAudioContext();
  console.log(ctx.sampleRate);
  
  // Play a video with audio encoded at 48000 Hz
  video2.play();
  
  // This will console log 48000
  var ctx = new webkitAudioContext();
  console.log(ctx.sampleRate);
  </code></pre>
  
  <p>I could check in the code when the sample rate is changed but before my sound starts I cannot change it. Also <a href="http://updates.html5rocks.com/2012/01/Web-Audio-FAQ" rel="nofollow noreferrer">this</a> sugests you cannot do that. Refreshing the whole page is also not an option for me. </p>
  
  <p>So is there a way I could properly play my sound after the video?</p>
  
  <p>EDIT:</p>
  
  <p>So I've encoded all the videos and audio to the same sample rate(44100). However, when the app starts on an iPad the first video plays with only 24000 sample rate! although it works fine, another sound starts which is distorted.</p>