FireZenk / FireZenk/AudioWaves

How to use your library when recording audio using mic?

Open
#9 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
826
Forks
156
PR merge metrics
No merged PRs in 30d

Description

Hello!

Thank you for sharing your work!

I am struggling to make it work in parallel with audio recording. I get MediaRecorder IllegalState exception again and again.

I am using your visualiser this way:

```
private void startRecording() {
mRecorder = new MediaRecorder();
mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
mRecorder.setOutputFile(mFileName);
mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_WB);

try {
mRecorder.prepare();
} catch (IOException e) {
Timber.e("prepare() failed");
}
mRecorder.start();
mVisualizer.startListening();
}

private void stopRecording() {
mVisualizer.stopListening();
mRecorder.stop();
mRecorder.release();
mRecorder = null;
}
```

What do I do wrong?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.