SoFunction
Updated on 2024-11-14

python3 implement speech to text (speech recognition) and text to speech (speech synthesis)

Without further ado, here are some screenshots of the code in action.

1. Speech synthesis

------->

Implementation:

直接输入要转换的内容

Results:

在这里插入图片描述

Input the content to be converted, the program directly help you to output the converted mp3 file (because the next step - speech recognition - need .pcm format file, the program automatically performs format conversion, while generating the file, don't care about it for the time being, (you can also change the default parameters to change the location of the file output, the name and whether to carry out the pcm conversion
<-------

2. Speech processing

---->
For convenience, we'll run the voice processing program directly, recognizing the file from our previous step:

识别结果

What? Recognition actually appeared a little error, but do not worry, bloggers have called hundreds of times, the overall effect is still able to meet most of the needs of the

<----

Well, the code has been demonstrated, so if you need it, you can take it directly from my github, you're welcome!

git address: Github:maker_training_camp

Finally, a reminder: speech synthesis and recognition correspond to chr_to_mp3.py and mp3_to_chr.py respectively (haha, you should be able to tell by the names).
Note: windows running the program may not be able to output the file (you need to install the dependencies) but does not affect the sound synthesis, linux everything is normal (also installed dependencies, dependencies in the code has been reflected)

to this article on python3 to achieve speech to text (speech recognition) and text to speech (speech synthesis) of the article is introduced to this, more related python3 speech to text and text to speech content, please search for my previous posts or continue to browse the following related articles I hope that you will support me in the future!