Skip to content
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

how to collect the raw microphone data during recording ? #93

Open
woosungchu opened this issue Jan 30, 2018 · 2 comments
Open

how to collect the raw microphone data during recording ? #93

woosungchu opened this issue Jan 30, 2018 · 2 comments

Comments

@woosungchu
Copy link

While I try to make my previous cordova project to nativescript style, which can analyze
raw audio data in real-time, this open-source help me a lot.

But I think it hasn't proper API to collect the raw microphone data
like .. [ 0.003434 , -0.12355 , 0.0002323 ....... ] this.

Can you answer me if it have API or not?

@bradmartin
Copy link
Collaborator

I don't think so but if you can point me to a Cordova implementation (I assume this is a cordova plugin you've used) I can check the native APIs being used and see what needs to be addressed with this plugin. Thanks

@woosungchu
Copy link
Author

this demo is what I used.
https://github.com/edimuj/cordova-plugin-audioinput/blob/master/demo/file-demo.js

evt.data will return raw microphone data ( [ 0.003434 , -0.12355 , 0.0002323 ....... ] )

function onAudioInputCapture(evt) {
    try {
        if (evt && evt.data) {
            // Increase the debug counter for received data
            totalReceivedData += evt.data.length;
console.log(evt.data)
            // Add the chunk to the buffer
            audioDataBuffer = audioDataBuffer.concat(evt.data);
        }
    }
    catch (ex) {
        alert("onAudioInputCapture ex: " + ex);
    }
}

Or you can just clone and follow readme.md file
https://github.com/woosungchu/corodova-recording

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants