Giter Site home page Giter Site logo

recordmp3js's Introduction

Recordmp3js

Record MP3 files directly from the browser using JS and HTML

For an explanation on how it works check out the initial article: http://audior.ec/blog/recording-mp3-using-only-html5-and-javascript-recordmp3-js/

License

The MIT License (MIT)

Copyright (c) 2014 nusofthq

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Disclaimer

MP3 encoding/decoding technology may be governed by MP3 patents in some countries.

For the purpose of this project, only an external MP3 library was used namely libmp3lame.js, that was not developed by me.

recordmp3js's People

Contributors

cesine avatar kehers avatar octavn avatar pauln avatar remusnegrota avatar simzal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

recordmp3js's Issues

How to run the app

I downloaded the app and tried to run it. The system always freezes at "Converting to Mp3". Same for Firefox and Chrome. My OS is Ubuntu 14.04. What is the problem? Thanks.

Speakers echo microphone's sound

Hi,
when I open a page with the recorder, browser asks me to allow microphone. When I do it, speakers start echoing the sound from microphone, louder and louder.
How to fix this problem? I think the script should disable microphone after the recording is finished and enable it when I press 'start recording'.

save audio

iam going to save audio directly to server.

Mobile?

A few random redirections when trying to use this on a mobile device. Is this a known issue? Seems like a timeout of some sort. Although the audio IS successfully making it to the server.

Benchmarks ?

Hey i have just seen this and this is crazy, but I am curious... so benchmark maybe ?

Too Funny Didn't Made Sense:
Add some benchmarks maybe ?

conversion simultaneous to recording

great library,
has anybody tried to implement this with a web worker to make conversion simultaneous to recording?
like https://github.com/blixt/js-lameworker (because of that blixt library works faster),
Looking at js folder it seems this uses workers but it's then much slower than https://github.com/blixt/js-lameworker , i wonder why

in https://github.com/blixt/js-lameworker i had the issue that successive recordings would end up hanging,

has anybody tried this library with multiple successive recordings?

best

Recordings folder is not created

It records perfectly and converting into mp3 format.
But folder named Recordings in upload.php is not created while running in tomcat server.

`exportWAV` is not re-entrant

When I call exportWAV multiple times without waiting for it to execute its callback cb, using different callback functions each time, eventually only the last callback function I passed will fire, but it will fire multiple times.

This is because currCallback is held as an instance level variable - the intuitive behavior would be that the callback can be different for each call to exportWAV.

Separate the mp3 upload process from the encoding process?

Trying to change the flow of this so that I can choose the mp3 that I want to be uploaded to the server. Currently, I record then wav and mp3 is created and then mp3 is uploaded to the server. I only want to do the mp3 upload to the server on another button click or other event, not automatically as part of this process.

Any ideas/suggestions how to do that? I was thinking to make this two processes where one lib only has the wav encoding processes so that it works just as the basic original recorder works and then another lib with the mp3 and upload processes and then just change all the names to something unique so I can call them separately, but this is more of a hack then a solution and I am not even sure it would work since I need to get the audio blob from somewhere.

Audio getting chopped off (Wrong project, Ignore)

The audio was getting chopped off, so I made this small change to Recorder.js and it has seemed to fix the problem. The issue is that the 'data' message is sent and then lame is flushed and an a 'end' message is sent with the rest. So, I append the two here and that seems to work.

Just for anyone else who has the same issue.

        let outBuff;
        encoderWorker.onmessage = function (e) {
            if (e.data.cmd == 'data') {
                outBuff = e.data.buf;
            }

            if(e.data.cmd === 'end') {
                console.log("Done converting to Mp3");

                const base64 = encode64(appendBuffer(outBuff, e.data.buf));
                currCallback(base64);

                function appendBuffer( buffer1, buffer2 ) {
                    const tmp = new Uint8Array( buffer1.byteLength + buffer2.byteLength );
                    tmp.set( new Uint8Array( buffer1 ), 0 );
                    tmp.set( new Uint8Array( buffer2 ), buffer1.byteLength );
                    encoderWorker.terminate();
                    return tmp.buffer;
                }

            }
        };

Mp3 convert of a long record may results in a buffer over flow

I've tried to record a 10 minutes sample on the demo page http://audior.ec/recordmp3js/
I click on stop button then it starts to convert to Mp3 and it raises a buffer over flow error after a few minutes

Converting to Mp3
Version : 3.99.5 /  Mode: 3 /  Samples: -1 /  Channels: 1 /  Input Samplate: 44100 /  Output Samplate: 44100 /  Bitlate :32 /  VBR :0
Uncaught buffer over flow
    Lame.encode_buffer_ieee_float @ /recordmp3js/js/libmp3lame.min.js:1446
    self.onmessage @ /recordmp3js/js/mp3Worker.js:31

Sound deformation on windows

We are having a problem of sound deformation on windows.

We are recording the sound and then converting it to mp3. It works perfectly on Mac but we are having problems on windows : the voice is slower like a sampleRate problem.

We tried to play with the sampleRate during mp3 conversion but it does not fix the problem.

I am sure there is something we are missing, any help would be greatly appreciated !!!

Thank you very much.

Uncaught RangeError: Invalid array buffer length

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.