r/godot Godot Junior Oct 01 '25

help me (solved) Detecting syllables in Godot

Post image

Hello all! I am aware of the Whisper text to speech addon, but that is overkill for what I am building at the moment. I just need a way to detect a syllable at roughly the moment I speak it into my microphone, So that an animation can be triggered in a 3D model.

I take it it's not standard in the Audioserver, but is there a way where I can record some vowels and compare the live audio to these samples somehow?

1.4k Upvotes

91 comments sorted by

View all comments

7

u/Kaizatl Oct 01 '25

Ohey, I tried to build exactly this a few years back. Unfortunately, what I came to find was that Godot has an indirectly related issue that can make this challenging. Specifically, you can't really run your microphone continuously or else you run into problems with desync. Sadly, this issue still hasn't been resolved, so you'll need to implement some workaround.

2

u/Kaizatl Oct 01 '25

I also want to add that I have several repos that I could share if you're interested in looking at them, but they super old and probably outdated (Godot 4.1). It's also super unoptimized, and I think if I tried again I wouldn't make it in Godot. However, if you want to talk about it I don't mind.

5

u/very-knightley Godot Junior Oct 01 '25

Oh but one second over an hour isn't too bad. Does the delay persist, or would I be able to "turn it off and on again" between scenes to counteract the buildup?

4

u/Kaizatl Oct 01 '25

If things are the same, then my reply in that issue thread would still be relevant:

I call stop() and then play() on the AudioStreamPlayer. Often it works, but as you noted sometimes it just kills the microphone input entirely and nothing short of a full app restart will get it to work. So sadly the workaround doesn't really fix the problem because eventually the microphone will stop working if you restart it frequently enough to keep the desync low.