mltony / nvda-phonetic-punctuation

Phonetic punctuation is an NVDA add-on that allows to convert punctuation signs into audio icons. It can also convert any regular expressions into audio icons.
GNU General Public License v2.0
12 stars 5 forks source link

conflict with the speech history addon #7

Open vortex1024 opened 3 years ago

vortex1024 commented 3 years ago

when phonnetic punctuation is enabled, speech history doesn't work. I don't know whether one party holds the exclusive blame, so I'm posting here in hope that the two authors could solve this together. The related speech history issue, where detailed NVDA logs can be found, is: https://github.com/jscholes/nvda-speech-history/issues/22 thanks

mltony commented 3 years ago

Judging by the stacktrace doesn't appear to be a problem with phonetic punctuation. I briefly looked at speech history - it appears that it can't handle speech sequences that are already modified by phonetic punctuation. Hard to tell the reason without debugging. But from a glance there doesn't appear to be a reason to believe that something is wrong with phonetic punctuation. Debugging of speech history is needed.

On 7/30/2021 10:56 AM, vortex1024 wrote:

when phonnetic punctuation is enabled, speech history doesn't work. I don't know whether one party holds the exclusive blame, so I'm posting here in hope that the two authors could solve this together. The related speech history issue, where detailed NVDA logs can be found, is: jscholes/nvda-speech-history#22 https://github.com/jscholes/nvda-speech-history/issues/22 thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mltony/nvda-phonetic-punctuation/issues/7, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIJRDHDDMMATXKCDOJN3X7TT2LRVNANCNFSM5BI6XEUQ.

vortex1024 commented 3 years ago

by speech sequences modified by phonetic punctuation, do you mean sequences with callbacks which call a function to make sound? i.e. sequence=(speech.CallbackCommand(callback=a), text, speech.CallbackCommand(callback=b)) where a and b are functions with play sound? If not, can you give an example, please? I'm planning to use such a sequence, with phonetic punctuation disabled, to test your theory.

mltony commented 3 years ago

If you have some programming skills, here is what you can do. IN PhoneticPunctuation.py set debug=True, then on line 46 set the log file to some real file on your computer and then it will log every sequence to that file - logging happens in def preSpeak: mylog(str(newSequence)) Then you'll have an idea what phonetic punctuation outputs to speech.speak and you can further debug why that breaks the other addon.

On 8/1/2021 12:37 AM, vortex1024 wrote:

by speech sequences modified by phonetic punctuation, do you mean sequences with callbacks which call a function to make sound? i.e. sequence=(speech.CallbackCommand(callback=a), text, speech.CallbackCommand(callback=b)) where a and b are functions with play sound? If not, can you give an example, please? I'm planning to use such a sequence, with phonetic punctuation disabled, to test your theory.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mltony/nvda-phonetic-punctuation/issues/7#issuecomment-890468517, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIJRDHELVFVFXNUTAKKAPRTT2T2U7ANCNFSM5BI6XEUQ.

vortex1024 commented 3 years ago

Just did that. The interesting thing is that, even with phonetic punctuation disabled with the keyboard shortcut, speech history still doesn’t work. The only way to make it work is if I comment the call to inject speech interceptor in pp. Does pp modify the speech sequence even when disabled, or could the interception itself be a problem? I think I saw interception chains like this working fine. From: mltony Sent: Sunday, August 1, 2021 9:03 PM To: mltony/nvda-phonetic-punctuation Cc: vortex1024 ; Author Subject: Re: [mltony/nvda-phonetic-punctuation] conflict with the speech history addon (#7)

If you have some programming skills, here is what you can do. IN PhoneticPunctuation.py set debug=True, then on line 46 set the log file to some real file on your computer and then it will log every sequence to that file - logging happens in def preSpeak: mylog(str(newSequence)) Then you'll have an idea what phonetic punctuation outputs to speech.speak and you can further debug why that breaks the other addon.

On 8/1/2021 12:37 AM, vortex1024 wrote:

by speech sequences modified by phonetic punctuation, do you mean sequences with callbacks which call a function to make sound? i.e. sequence=(speech.CallbackCommand(callback=a), text, speech.CallbackCommand(callback=b)) where a and b are functions with play sound? If not, can you give an example, please? I'm planning to use such a sequence, with phonetic punctuation disabled, to test your theory.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mltony/nvda-phonetic-punctuation/issues/7#issuecomment-890468517, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIJRDHELVFVFXNUTAKKAPRTT2T2U7ANCNFSM5BI6XEUQ.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

mltony commented 3 years ago

No, when it's disabled it doesn't modify speech sequence.

Then maybe look at this line:

return originalSpeechSpeak(newSequence, symbolLevel=symbolLevel, *args, **kwargs)

Maybe the other addon changed signature of speak() method so that it cannot properly process arguments.

On 8/1/2021 12:34 PM, vortex1024 wrote:

Just did that. The interesting thing is that, even with phonetic punctuation disabled with the keyboard shortcut, speech history still doesn’t work. The only way to make it work is if I comment the call to inject speech interceptor in pp. Does pp modify the speech sequence even when disabled, or could the interception itself be a problem? I think I saw interception chains like this working fine. From: mltony Sent: Sunday, August 1, 2021 9:03 PM To: mltony/nvda-phonetic-punctuation Cc: vortex1024 ; Author Subject: Re: [mltony/nvda-phonetic-punctuation] conflict with the speech history addon (#7)

If you have some programming skills, here is what you can do. IN PhoneticPunctuation.py set debug=True, then on line 46 set the log file to some real file on your computer and then it will log every sequence to that file - logging happens in def preSpeak: mylog(str(newSequence)) Then you'll have an idea what phonetic punctuation outputs to speech.speak and you can further debug why that breaks the other addon.

On 8/1/2021 12:37 AM, vortex1024 wrote:

by speech sequences modified by phonetic punctuation, do you mean sequences with callbacks which call a function to make sound? i.e. sequence=(speech.CallbackCommand(callback=a), text, speech.CallbackCommand(callback=b)) where a and b are functions with play sound? If not, can you give an example, please? I'm planning to use such a sequence, with phonetic punctuation disabled, to test your theory.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub

https://github.com/mltony/nvda-phonetic-punctuation/issues/7#issuecomment-890468517,

or unsubscribe

https://github.com/notifications/unsubscribe-auth/AIJRDHELVFVFXNUTAKKAPRTT2T2U7ANCNFSM5BI6XEUQ.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mltony/nvda-phonetic-punctuation/issues/7#issuecomment-890574335, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIJRDHDWU65BL2CIUW6EFG3T2WOVJANCNFSM5BI6XEUQ.

vortex1024 commented 3 years ago

yes, change of signature is certainly the culprit. someone on the speech history issue suggested loading speech history first, thus letting it override speak() before pp, and htis solved the problem. Not the ideal solution, but at least it works

tspivey commented 2 years ago

This is a bug in phonetic punctuation.

phonetic punctuation patches both speech.speak and speech.speech.speak, but only calls the original speech.speak. speech history patches speech.speech.speak, but not speech.speak.

XLTechie commented 2 years ago

@mltony, have you considered @tspivey's comment above?

I am concerned about possible interactions between your add-on, Speech History, and my own add-on Speech Logger, all of which patch speech.speech.speak.

mltony commented 2 years ago

I'll try to find some time to address this in the next release.

On 5/23/2022 8:54 PM, Luke Davis wrote:

@mltony https://github.com/mltony, have you considered @tspivey https://github.com/tspivey's comment above https://github.com/mltony/nvda-phonetic-punctuation/issues/7#issuecomment-1054120293?

I am concerned about possible interactions between your add-on, Speech History, and my own add-on Speech Logger https://addons.nvda-project.org/files/get.php?file=splogger, all of which patch speech.speech.speak.

— Reply to this email directly, view it on GitHub https://github.com/mltony/nvda-phonetic-punctuation/issues/7#issuecomment-1135373927, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIJRDHHTPWJNT2AKGS7NEVTVLRHJDANCNFSM5BI6XEUQ. You are receiving this because you were mentioned.Message ID: @.***>