Android Question SpeechToText Recording issue

John Naylor

Active Member
Licensed User
Longtime User
Hey all!

I am playing about with SpeechToText by @Biswajit and all is well apart from when I use the SpeechToTextRec - The STT_MicrophoneBuffer sub never gets called so I cannot replay the audio after STT has taken place (the actual speech to text works). As such when player.StartPlaying is called there is no data in the buffers.

I have been searching the forums for anyone else with the same problem but I cannot find any mention. Does anyone have an idea?

B4A 13.4
jdk-19.0.2
Manifest set to 25 and 35 both tried
SpeechToText 1.5
Samsung Galaxy S22 Ultra
Android 16
Tried in debug & release
No errors showing in logs (filtered or unfiltered)

Anyone have any ideas?
 

neilarnold

New Member
If speech to text is working but STT_MicrophoneBuffer is never called, it sounds like the recording callback is not being triggered. First check that you are using SpeechToTextRec correctly and that the buffer event is enabled in the library settings. Also make sure you have record audio permission granted at runtime, not just in the manifest. You can try adding a log line inside STT_MicrophoneBuffer to confirm it never fires, and test on another device to rule out a device issue.
 
Upvote 0

John Naylor

Active Member
Licensed User
Longtime User
If speech to text is working but STT_MicrophoneBuffer is never called, it sounds like the recording callback is not being triggered. First check that you are using SpeechToTextRec correctly and that the buffer event is enabled in the library settings. Also make sure you have record audio permission granted at runtime, not just in the manifest. You can try adding a log line inside STT_MicrophoneBuffer to confirm it never fires, and test on another device to rule out a device issue.
Permissions are all granted, I have logged the buffer event, I am using SpeechToTextRec. What do you mean 'library settings'? I am just using the demo app exactly as it was supplied.
 
Upvote 0
Top