Add verbose debug log for SAPI4#17774
Merged
Merged
Conversation
seanbudd
reviewed
Mar 5, 2025
seanbudd
reviewed
Mar 5, 2025
seanbudd
left a comment
Member
There was a problem hiding this comment.
thanks @gexgd0419, can you change the format strings to f-strings?
seanbudd
approved these changes
Mar 6, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to issue number:
None
Summary of the issue:
In #17718, I changed the SAPI4 synthesizer code, so that SAPI4 can now use WASAPI WavePlayer for audio output. This was done by creating a custom audio output destination class, and let the SAPI4 engines use the custom destination instead of the built-in
MMAudioDestto output audio.The engines interact with the audio destination object directly, and each engine may have its own way to use the audio destination object. So while the current implementation works with some of the SAPI4 engines, it may not work well with some other engines. As different engines have different behaviors, it may be impossible to replicate the same issue with another voice.
It would be better if I can get access to the exact same voice and study its behavior. But many of those voices are commercial products, which require purchasing and activating, so I cannot easily get the voices.
The second option is to get the log file from the user and study the logs. While I am using logs to debug on my side, the logs may be too chatty for regular users, because every audio chunk would be logged, so I decided to leave the logging part out. But now I find it difficult to diagnose SAPI4-related problems without logs when I can't get access to the voice.
Description of user facing changes
When the debug log category
synthDriverin the advanced settings page is enabled, additional verbose SAPI4 logs will be enabled, which includes most of the interactions between the SAPI4 engine and the custom audio destination object, including every audio data write.This can log many lines when using SAPI4 voices, so it's recommended to keep the log disabled when not necessary.
Description of development approach
Added logging in the SAPI4 module, which can be enabled or disabled by the
synthDriverdebug log category.Testing strategy:
Tested manually.
Known issues with pull request:
Code Review Checklist:
@coderabbitai summary