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

Initialization failed #3

Open
atlanlin opened this issue Feb 22, 2016 · 2 comments
Open

Initialization failed #3

atlanlin opened this issue Feb 22, 2016 · 2 comments

Comments

@atlanlin
Copy link

I got an alert error saying that "AudioRecord initialization failed".

I used the same code as the example.

var recorder = new martinescu.Recorder('/record.wav', { sampleRate: 22050 }, statusCallback, bufferCallback);

May I know why I am getting this error?

@davidkaste
Copy link

Same here!

@guptaankit2190
Copy link

guptaankit2190 commented Jul 12, 2016

Please replace code in file ExtAudioRecorder.java and do not use '/' before it will work
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
filePath = Environment.getExternalStorageDirectory().getAbsolutePath() + argPath;
} else {
filePath = "/data/data/" + handler.cordova.getActivity().getPackageName() + argPath;
}

TO:

if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
filePath = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + argPath;
} else {
filePath = "/data/data/" + handler.cordova.getActivity().getPackageName() + "/cache/" + argPath;
}

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

3 participants