loadAndPlaySoundFile(){
    let audioElement = this._audioPlayerElement;
    let inputElement = this._audioInputElement;
    let reader = new FileReader(); 
    
    reader.onload = function(e) { //When we've loaded the file...
      audioElement.src = this.result; //Link up the sound element with it.
      audioElement.controls = true; //Displays default audio controls to the user.
      audioElement.play();
    };   
    
    reader.readAsDataURL(inputElement.files[0]); //Files is an array of all the files selected, we just take the first one.
    this.createAudioObjects();
  }
/**
   * User loads a sound file from their system, which is loaded into the website. 
   * Then creates the audio objects for music visualisation and plays the music.
   */
User loads a sound file from their system, which is loaded into the website.
Then creates the audio objects for music visualisation and plays the music.
User loads a sound file from their system which is loaded into the website . Then creates the audio objects for music visualisation and plays the music .
loadAndPlaySoundFile(){
    let audioElement = this._audioPlayerElement;
    let inputElement = this._audioInputElement;
    let reader = new FileReader(); 
    reader.onload = function(e) { 
      audioElement.src = this.result; 
      audioElement.controls = true; 
      audioElement.play();
    };   
    reader.readAsDataURL(inputElement.files[0]); 
    this.createAudioObjects();
  }
loadAndPlaySoundFile ( ) { let audioElement = this . _audioPlayerElement ; let inputElement = this . _audioInputElement ; let reader = new FileReader ( ) ; reader . onload = function ( e ) { audioElement . src = this . result ; audioElement . controls = true ; audioElement . play ( ) ; } ; reader . readAsDataURL ( inputElement . files [ 0 ] ) ; this . createAudioObjects ( ) ; }
User loads a sound file from their system, which is loaded into the website.
User loads a sound file from their system which is loaded into the website .
//When we've loaded the file... //Link up the sound element with it. //Displays default audio controls to the user. //Files is an array of all the files selected, we just take the first one.