title: decoding a bin file to mp3 using Node Js
body: <p>I am encoding a MP3 file to Base64 in Node Js using this method : </p>
  
  <pre><code>encodebase64 = function(mp3file){
  var bitmap = fs.readFileSync(mp3file);
  var encodedstring = new Buffer(bitmap).toString('base64');
  fs.writeFileSync('encodedfile.bin', encodedstring);}
  </code></pre>
  
  <p>and then again I want to construct the MP3 file from the Base64 bin file, but the file created is missing some headers , so obviously there's a problem with the decoding.
  the decoding function is : </p>
  
  <pre><code>decodebase64 = function(encodedfile){
  var bitmap = fs.readFileSync(encodedfile);
  var decodedString = new Buffer(bitmap, 'base64');
  fs.writeFileSync('decodedfile.mp3', decodedString);}
  </code></pre>
  
  <p>I wondered if anyone can help
  Thanks.</p>