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 use your library when recording audio using mic? #9

Open
Gaket opened this issue Nov 6, 2016 · 2 comments
Open

How to use your library when recording audio using mic? #9

Gaket opened this issue Nov 6, 2016 · 2 comments

Comments

@Gaket
Copy link

Gaket commented Nov 6, 2016

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?

@liuzhen2008
Copy link

@Gaket have you resolved the issue yet? I ran into the same issue.

@Gaket
Copy link
Author

Gaket commented Dec 2, 2016

@liuzhen2008, unfortunately, not. Now I am using just static image. Tell me please if you solve the problem.

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