HBiSoft / HBRecorder

Lightweight screen recording Android library
MIT License
402 stars 137 forks source link

Enable Audio Recording while video is in Progress #122

Closed hemandroid closed 2 years ago

hemandroid commented 2 years ago

Hi Team,

I tried using the plugin and when I enable the audio as default before video record starts. It's working perfectly, but before video recording starts, I disable the Audio and enabled it after starting the video recording. This time, video is not recording the audio.

I tried like below

private void setRecordAudioCheckBoxListener() {
        recordAudioCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
            @Override
            public void onCheckedChanged(CompoundButton compoundButton, boolean isChecked) {
                //Enable/Disable audio
                isAudioEnabled = isChecked;
                hbRecorder.isAudioEnabled(isChecked);
            }
        });
    }

Please suggest how to handle the audio recording along with Screen recording dynamically.

HBiSoft commented 2 years ago

It's not currently possible, but shouldn't be hard to implement.

hbRecorder.isAudioEnabled(isChecked) is meant to be set before starting the recording.

I will have a look at it later today. I will let you know when I'm done adding it to the library.

hemandroid commented 2 years ago

Thank you so much for quick response @HBiSoft. I have the deliverables by Monday. So this feature update, will really help me a lot.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed if no further activity occurs within the next 3 days. Thank you for your contributions.