How can I get the sound I recorded in a file in flutter as a string(text) every word of it?
as an example, he will say hello world in the audio file.How can I get this as a string
String getText = "hello world";
i know about google's speech-to-text product, but it seems too expensive, isn't there another way for me to do it?
Asked
Active
Viewed 2,492 times
0

Hasancan Çakıcıoğlu
- 232
- 2
- 10
1 Answers
4
Try this package
To convert audio to text use the code below
Future<List<int>> _getAudioContent(String name) async {
final directory = await getApplicationDocumentsDirectory();
final path = directory.path + '/$name';
return File(path).readAsBytesSync().toList();
}
final audio = await _getAudioContent('test.wav');
final response = await speechToText.recognize(config, audio);
print(response);

Kaushik Chandru
- 15,510
- 2
- 12
- 30
-
thank you for your help, but that's not what I wanted.I won't speak, I need the words in an audio file I received – Hasancan Çakıcıoğlu Mar 11 '22 at 06:51
-
thank you for your help, but as I mentioned at the top, the cost of that package exceeds me.I'm looking for if there is a free way – Hasancan Çakıcıoğlu Mar 11 '22 at 15:38
-
@IstakozNecmi Build your own API. Get a pre-trained AI from tf hub or huggingface, then deploy with Flask or Django. It may take a lot of effort – Philip Purwoko Jul 23 '22 at 03:03