如何在Python中拆分wav文件中的单词?
例如 wav 文件是(“你好吗?”)我想分割 3 个 wav 文件,如(“如何”),(“是”),(“你”)。你能帮我吗?
e.g wav file is("How are you ?") ı want to split 3 wav file like as ("How"), ("are"), ("you").Could you help me ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你可以尝试这个,但是你需要知道每个单词的时间戳,除非你使用机器学习。如果您知道每个单词末尾的时间戳,例如,在 1 之后是 1,在 2 之后是 2,在 2.7 之后是 2.7,请尝试此操作。
文件将保存为 1-word.wav、2-word.wav 等。
如果您不知道时间,您可以尝试此代码,它会监听静音或暂停。
然而,听完音频文件后,背景噪音很大,单词之间没有明显的停顿。
然后你说你想将音频翻译成文本,试试这个代码。
首先安装所需的库。
然后运行这个,
我得到输出,
不确定这是否正确,因为我不会说土耳其语,但我听了它,听起来是正确的。
You can try this, but you need to know the timestamp of each word, unless you use machine learning. If you know the time stamps at the end of each word, for example, after how it's 1, after are its 2 and after you its 2.7, try this.
The files will be saved as 1-word.wav, 2-word.wav etc.
If you don’t know the timings, you can try this code, it listens for silences or pauses.
However, after listening to the audio file, there is a lot of background noise and no clear pauses between words.
You then said that you want to translate the audio to text, try this code.
First install the required libraries.
Then run this,
I get the output,
Not sure if this is correct as I don't speak turkish, but i listened to it and it sounds correct.