title: Tone.js not working with React
body: <p>I want to implement a basic Tone Player to load a file from a folder and play it by pressing a button in ReactJS.</p>
  
  <pre><code>import React, { Component, PropTypes } from 'react';
  import ReactDOM from 'react-dom';
  import Tone from 'tone';
  import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
  import Slider from 'material-ui/Slider';
  import RaisedButton from 'material-ui/RaisedButton';
  
  
  let sound = new Tone.Player("kick.wav").toMaster();
  export default class App extends Component {
  
  render() {
  
      return(
          &lt;MuiThemeProvider&gt;
              &lt;div&gt;
                  &lt;Slider min={0} max={100} step={10} className = "Slider1Test1" style={{height: 400}} axis="y"/&gt;
                  &lt;RaisedButton label="A" className = "RaisedB1Test1" style={{width: 10}}/&gt;
  
                  &lt;Slider min={0} max={100} step={10} className = "Slider2Test1" style={{height: 400}} axis="y"/&gt;
                  &lt;RaisedButton label="B" className = "RaisedB2Test1" style={{width: 10}}/&gt;
              &lt;/div&gt;
          &lt;/MuiThemeProvider&gt;
      );
  }
  }
  </code></pre>
  
  <p>But this gives an error: </p>
  
  <blockquote>
    <p>Uncaught (in promise) DOMException: Unable to decode audio data modules.js?hash=625032f…:48100 Uncaught (in promise) Tone.Buffer:
    could not decode audio data: kick.wav</p>
  </blockquote>
  
  <p>I have tried "./kick.wav", "./kick.ogg", "./kick.mp3". I have tried giving complete paths. I have tried using only web audio by giving XMLHTTPRequest - it is the same error all the time.</p>
  
  <p>I am new to react - please let me know if there is a correct way to do this. Do I need to use componentDidMount? ( I have tried using that as well. Please let me know the correct way to do it).
  Thanks</p>