I'm managing to record audio using the recorderjs. It creates the audio. I'm using ruby rails. I save it. It sends the file correctly to my server. When I go to test and see if the audio is the same. It doesn't play and has a play time of 0 seconds.
I want to record an audio file that is 2-5 seconds long. then save that file on the server and it will be linked to a word.
File.open('public/mp3s/' + filename, 'wb') do |f|
It is likely that you have an encoding error, or a typo generating an empty file. The param could be a binary octet stream instead of base64 for instance. Or it could be coming in as a different key, in which case you'd make an empty file.
If you're on mac or linux, try using the
file command on the written file. The command should look at the magic byte, and if it is an MP3 you should see something along those lines.
Likewise, if you cat, hexdump, or notepad the file that rails saved, and the generated one you should be able to see any differences.
params[:mp3data] may also be
in development mode, the rails server should list the incoming params.