Recordmp3js icon indicating copy to clipboard operation
Recordmp3js copied to clipboard

Uncaught RangeError: Invalid array buffer length

Open lightmar opened this issue 10 years ago • 5 comments

Hi,

Thank you for this great plugin. Unfortunately I have a problem which I can't figure out. On some computers it works great, however on others when the recorded wav is passed to the libmp3lame, to I get the following error: Uncaught RangeError: Invalid array buffer length

I have discovered that the error occurs only when a user records microphone with a high sample rate of 192000. When I try it on my mac with 44000 input, it works.

How can it be fixed? Very important issue...

Thanks

lightmar avatar Dec 14 '14 12:12 lightmar

This is a limitation of the javascript mp3 library.

You can try and recompile the library using emscripten: http://kripken.github.io/emscripten-site/docs/getting_started/Tutorial.html, and increase the buffer size, but i don't know exactly what results you will get. In anyway 44000 or 48000 sample rate is more than enough for a mono mp3.

nusofthq avatar Dec 15 '14 08:12 nusofthq

I don't mind converting in 44000 or 48000. The question is how I can convert the recorded audio to lower sample rate?

Thanks

lightmar avatar Dec 15 '14 08:12 lightmar

How is it possible to make this plugin work for all devices? It just doesn't work on PCs on which the recording configuration is high like 192000. I will appreciate any help.

lightmar avatar Dec 15 '14 12:12 lightmar

@lightmar did you find how to reduce the sample rate?

michelboudali avatar Aug 29 '16 14:08 michelboudali

@lightmar @michelboudali yeah it doesnt work for me too on windows machine when i try to record in 32kbps bitrate. 64kbps works on windows and 32 works on mac.. any fix for this. I would like to record with 32kbps to keep the size low.

z-shan avatar Sep 20 '16 22:09 z-shan