How do you require() a sound file in React Native?
<p>I'm using <a href="https://github.com/zmxv/react-native-sound" rel="noreferrer">https://github.com/zmxv/react-native-sound</a> to play sounds on my iOS (and Android) app, and I'm trying to include sound files through React Native's asset system, but when I call:</p>

<p><code>var sound = require('./sound.mp3');</code></p>

<p>I get the error:</p>

<blockquote>
  <p>Unable to resolve module ./sound.mp3 from [project]/index.ios.js: Invalid directory [project]/sound.mp3</p>
</blockquote>

<p>I have my MP3 file in the correct (root) directory of my project, the exact same file path that the error is printing. I've tried putting it in other directories as well.</p>

<p>According to <a href="https://github.com/facebook/react-native/issues/1043#issuecomment-97249646" rel="noreferrer">this thread</a>, it sounds like sound files should be able to be packaged using require() as well?</p>

<p>Just doing a test, requiring an image works perfectly:
<code>var image = require('./image.png');</code></p>