-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In browser conversion #4
Comments
note you have //TODO write to output |
what would be the best way to write to output? |
i've tried the method below but the audio sounds a bit distorted, assist me please
|
what is the application you are trying to write? |
a wav to mp3 file converter |
is your wav file mono or stereo? |
so far i've been using Left44100.wav as my test file, but i would like to do stereo |
Is it possible to give us a hint or sample code on how to write the mp3 to disk? Trying just a short mono wav file, encoded to mp3 using lamejs. I successfully reach the end of encoding, but can't force a download with "createObjectURL". I still have much to learn with blobs, etc... Thanks in advance! |
@calipoop If you can successfully get an object url from the blob, just set that url as the href of an tag. Clicking on that will download the mp3. Set the content-type in the blob to something like application/octet-stream instead of media/mpeg to have the browser download instead of playing directly in the browser. |
Thanks @shanewho - I've successfully downloaded files before (using the HTML5 download tag targeting modern browsers). Trouble is I can't get the object url from the blob, or maybe I'm not creating the blob correctly. I've tried multiple versions of this code (I think mp3buf is the final encoded mp3):
The downloaded result ends up being a short burst of noise, so I must be doing something wrong... |
You can pass the mp3buf directly to the blob (in an array). Try this instead:
|
we have this push-to-record script implemented which whoever wrote it used a slightly modified version of this script [http://typedarray.org/from-microphone-to-wav-with-getusermedia-and-web-audio/]. it works just fine but the files it generates are in wav and huge, even in mono. I've been trying to use this library to output mp3 files instead of wav but I'm confused as to which point in that script I should insert the mp3 encoding script. I don't need to keep the wav file. I'm not ashamed to say it's outside my comfort zone and I would very much appreciate any help. thanks in advance. |
Firstly this is an awesome library.
I'm trying to do an in browser conversion. Don't know what's wrong here, could you please assist?
see html below
The text was updated successfully, but these errors were encountered: