RuntimeAudioImporter icon indicating copy to clipboard operation
RuntimeAudioImporter copied to clipboard

Toggling mute without hitching in UE5.3

Open mxbi opened this issue 1 year ago • 3 comments

Hi! Thank you for such an awesome plugin.

I want to implement push-to-talk functionality and so want to frequently mute and unmute a recording.
I initially used Start Capture and Stop Capture, but that caused hitching as described in https://github.com/gtreshchev/RuntimeSpeechRecognizer/wiki/6.-Minimizing-freezes#capturable-sound-wave.

Following that, I tried using Toggle Mute to improve performance, but the hitching persists. Looking at the source, it looks like for UE5.3, this is aliased back to Start/Stop Capture:

https://github.com/gtreshchev/RuntimeAudioImporter/blob/main/Source/RuntimeAudioImporter/Private/Sound/CapturableSoundWave.cpp#L172-L184

Is there any recommended way to do this for UE5.3+?

mxbi avatar Feb 02 '24 15:02 mxbi

Hi, thanks for the feedback :)

The ToggleMute function used to work in earlier engine versions, but starting from version 5.3, it no longer functions correctly and leads to crashes, especially on Windows (I assume this issue may occur on other platforms as well). To avoid crashes and make sure it always works correctly, I modified it to essentially be implemented as the StartCapture<->EndCapture starting from version 5.3.

For now, I'm not sure if it's possible to solve this in-place, so unfortunately it's on hold for now.

gtreshchev avatar Feb 02 '24 20:02 gtreshchev

@gtreshchev Sorry my amatuer response before. I rellay appriceate your project, it easy to use and reliablity. Thank you so much. But the ToggleMute in 5.3 is rellay annoying me. I finally found the bug, and contrubite the code to EpicTeam. If you had be the member of EpicGame , you can see it. https://github.com/EpicGames/UnrealEngine/pull/12092 Briefly, they forgot to set the CaptureThread to nullptr when the thread stop. When you call StartStream again will cause the check been Error.

So this issus only effect on Windows. #70 If you have time you can check by yourself. Thanks your wonderful pluing again.

q2a3z avatar Jul 05 '24 09:07 q2a3z

@gtreshchev Sorry my amatuer response before. I rellay appriceate your project, it easy to use and reliablity. Thank you so much. But the ToggleMute in 5.3 is rellay annoying me. I finally found the bug, and contrubite the code to EpicTeam. If you had be the member of EpicGame , you can see it. EpicGames/UnrealEngine#12092 Briefly, they forgot to set the CaptureThread to nullptr when the thread stop. When you call StartStream again will cause the check been Error.

So this issus only effect on Windows. #70 If you have time you can check by yourself. Thanks your wonderful pluing again.

Thank you! Hopefully Epic Games will review it before UE 5.5 release. Most PRs and bugs are reviewed for 1st party support and companies with UDN subscriptions, and the company is on break right now, so no one will look at that PR until a couple of weeks from now at the earliest, as Dannthr mentioned in Unreal Slackers (Source). We can just hope that the PR will be reviewed and merged soon :)

gtreshchev avatar Jul 06 '24 20:07 gtreshchev