samtupy / nvgt

The Nonvisual Gaming Toolkit
https://nvgt.gg
Other
51 stars 30 forks source link

builtin tts_voice::set_xxx not working? #51

Open valiant8086 opened 3 months ago

valiant8086 commented 3 months ago

Are we aware the builtin voice currently isn't responding to any of the tts_voice::set_xxx methods, such as rate? I see some code that seems to be deliberately assigning the values to it when using these umbrella methods, but I can't get it to reproduce any behavior changes with pitch, volume or rate.

At the risk of getting confusing talking of two possibly unrelated issues in one issue, Pitch isn't working with the SAPI voices on Windows anyway, as far as I can figure, but I never got that to work even in Bgt. If this is something I'm not doing right, if someone tells me what the secret to getting pitch to work is I can add that to the docs.

braillescreen commented 3 months ago

This is certainly interesting. I can just run those from the docs and they properly set those settings to Microsoft David with those settings applied, such as volume or rate. The only one that does not work based on a test I'll paste below is pitch.

[edit]: I honestly didn't remember that pitch wasn't supported anyway before writing it.

void main() {
    tts_voice v;
    v.set_pitch(100);
    v.speak("test");
    wait(600);
    v.set_pitch(250);
    v.speak_wait("Test waiting");
}
valiant8086 commented 3 months ago

Is the builtin voice expected to not be responding at all to volume or rate. Would have to edit the rate test in the docs and include a v.set_voice(0); before changing the rate and volume, then verify that it doesn't change anything.

e.g. void main() { tts_voice v; v.set_voice(0); v.set_volume(50); v.speak_wait("what's the volume now?"); v.set_volume(100); v.speak_wait("and how about now?"); }

For me both outputs from above are the same volume. It works for SAPI on Windows if I select voice 1 onward, but not for voice 0.

samtupy commented 3 months ago

Hi, So the fallback voice does not yet respond to rate/volume/pitch changes, however, it will. You can see in nvgt's repository we already have a copy of sonic in the dep folder which can apply these changes to any audio stream, however it has not yet been implemented into the fallback text to speech voice. I'll hopefully get to this soon. Thanks!

valiant8086 commented 3 months ago

shall we close this or keep it open as a reminder about implementing sonic to do pitch adjustment for builtin voice?

samtupy commented 3 months ago

Indeed I'd kept this open as a reminder for myself to get it done, it'll be closed from the commit which fixes the issue. Thanks!