title: Mobile Safari crashes while loading just one 2mb audio file on iPhone 4s
body: <p>I've stripped the problem right down to a few lines to isolate it. You can see it at <a href="http://radiorice.com/mobile/broken.html" rel="nofollow">http://radiorice.com/mobile/broken.html</a></p>
  
  <p>The audio file is available in aac and ogg formats. It plays fine in mobile Safari when loaded inside an <code>&lt;audio&gt;</code> element. But when I try to register it in SoundJS, Safari crashes with the "A problem occurred with this webpage..." message.</p>
  
  <p>The page works fine in desktop Safari, in Chrome and even in the version of mobile Safari I have running on an iPhone 4s in iOS simulator. There are no problems reported in the console for the simulator.</p>
  
  <p>Because the crash is always about 10s after the page loads I wondered if it was a problem relating to the mobile Safari 10s time limit and tried putting the registerSound call in a timeout() function with a 10s delay. That simply delayed the crash by 10s.</p>
  
  <p>I don't think this is a memory problem because the audio file can be loaded and played quite happily inside the <code>&lt;audio&gt;</code> tag.</p>
  
  <pre><code>&lt;html&gt;
  &lt;!DOCTYPE html&gt;
  &lt;head&gt;        
  &lt;script src="https://code.createjs.com/soundjs-0.6.0.min.js"&gt;&lt;/script&gt;
      &lt;script&gt;
          var sounds =[
              {id:"Sleep_Talk_Recorder", src:"Sleep_Talk_Recorder.m4a"}
          ];
          createjs.Sound.initializeDefaultPlugins();
          createjs.Sound.alternateExtensions = ["ogg"];
          createjs.Sound.on("fileload", handleLoad); // call handleLoad when each sound loads
          createjs.Sound.registerSounds(sounds, "../content/sounds/small/");
  
          function handleLoad(event) {
          console.log("Preloaded:", event.id, event.src);
          }
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;p&gt;Audio file plays fine:&lt;/p&gt;
      &lt;audio controls&gt;
      &lt;source src="../content/sounds/small/Sleep_Talk_Recorder.m4a" type="audio/aac"&gt;
      &lt;source src="../content/sounds/small/Sleep_Talk_Recorder.ogg" type="audio/ogg"&gt;
      Your browser does not support the audio element.
      &lt;/audio&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>