How do you call and load audio file from saf (and 'load' the audio into the SpeechRecognizer)?




i am using apk not companion

Post your blocks before using SAF.

here is my code blocks


when i click in my mobile many times in the button the app go close and i dont know why

use logcat to find out what happens

Taifun

but my app dont work, its just not the click button, its just how can read the wav file and i dont know why didnt work my blocks

My understanding is the SpeechRecognizer only takes input from the Android's microphone.

It can not take input from an audio file. You cannot load an audio file.

GetText() asks the user to speak, and converts the speech to text which is read by the AfterGettingText ( AfterGettingText(result,partial) is a simple event to raise after the SpeechRecognizer has recognized speech from the microphone; not an audio file.

Consequently your code cannot work.
These Blocks are probably wrong.

speechfromaudiofile

You might be able to use the Cloud Speech-to-Text with App Inventor https://cloud.google.com/speech-to-text?hl=en which supposedly can accept audio file input.

1 Like

so its not possible to convert audio to text using speechrecognizer?

I don't think it is possible using App Inventor Blocks.

its working but with errors you could check this but i dont know why the speechrecognizer stop mi dialog. its exist a form to get the speechrecognizer wihout limit time to speak?
mp3audio.aia (6.4 KB)
mp3audio (2).aia (6.5 KB)
mp3audio (1).aia (6.5 KB)

in my computer the aia is working its weird

using the stop block of the speechrecognizer, the speechrecognizer will be open listen or i need to use a timer?

aia finally downloaded. What are the error messages. What does 'its working' mean?

  • First, I do not think you can use an audio file to source the SpeechRecognizer
  • no one can check your code. We don't have the wave file . Is the recording in English? How long is it? Is it a file containing continuous speech or are there pauses ?
    To check the feasibility of your code, you can load an mp3 into Media and test without the SAF. Have you done that? Does the SpeechRecognizer recognize ANY words. Show us a screen capture please.

You might provide an aia with the wav file attached so someone could try loading the file into in Media and sourcing the SR from their instead of from the Download folder.

The problem could be

  • what you are attempting is impossible
  • what you are attempting is possible but the wave file you load is too long (timing issue.
  • wave file audio's pronunciation is not clear

Sorry, I can not debug this. :cry:

1 Like

Exactly, you have already explained everything necessary about this. :ok_hand:
And of course it doesn't matter which audio format (WAV, MP3, OGG, MA4, AAC,...) the PlayerScource uses.

so you download the aia but you tried to load your wav file and use the apk?. the other question is about the time o continuous speech i get other extensions about how tried to force speech continuos like this extension AI2 Speech Recognizer or this with kodular [FREE] Voice Recognition extension without Google Dialogue - Extensions - Kodular Community because i dont know how to use parrot with continuous speech. the tutorial dont explain this very easy

i know about this but the problem its not just the error its just the speech continuos of speech recognizer. i dont know how to use parrot correctly for get continous speech. in my last post show 2 links for continous speech and force to write the long audio wave file

Please do not mix several topics. Let's stay with the question of whether you can record the spoken sound played by a Player component with a SpeechRecognizer and convert it into text. And the answer is: no.

ok sorry about that, just am searching help for my app and i know that for you its not working correctly. i try to no mix the questions. so if i have a problem with speech recognizer continous i will have to create other post. thanks for help.