Skip to content

Conversation

cloudwebrtc
Copy link
Member

@cloudwebrtc cloudwebrtc commented Nov 11, 2022

fix: Restarting the playout without audio send streams makes the mic indicator off.

Copy link
Member

@davidzhao davidzhao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a great fix! would help resolve mic indicators across our other platforms too.

mind adding a bit of comment there? both to indicate we added it but also a bit about how it works.

auto* adm = config_.audio_device_module.get();
if (adm->Playing()) {
adm->StopPlayout();
if (adm->InitPlayout() == 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this mean? we are starting playout after stopping it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Through repeated tests, when the mode is changed to playback, the RTCAudioSession must be reset to stop the capture of the microphone.

Copy link
Member Author

@cloudwebrtc cloudwebrtc Nov 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add a commen describing the intent of this PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it, so it'd have to be restarted after Playout is stopped?

Copy link
Member Author

@cloudwebrtc cloudwebrtc Nov 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If playout is stopped, we should not need to restart it, only need to deal with adm->StopRecording() && adm->Playing()

It means that after the last audio send stream is closed, 1,stop recording, 2, and then reset to release the mic capture state.

@cloudwebrtc
Copy link
Member Author

Replaced with a more reasonable PR. #52

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

Successfully merging this pull request may close these issues.

2 participants