This repository has been archived by the owner on Apr 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 535
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
增加 wechat_echo 选项,支持将微信语音解析成指令(只支持百度stt)
- Loading branch information
Showing
4 changed files
with
68 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env python | ||
# coding: utf-8 | ||
import os | ||
from pydub import AudioSegment | ||
|
||
|
||
def mp3_to_wav(mp3_file): | ||
target = mp3_file.replace(".mp3", ".wav") | ||
if os.path.exists(mp3_file): | ||
voice = AudioSegment.from_mp3(mp3_file) | ||
voice.export(target, format="wav") | ||
return target | ||
else: | ||
print u"文件错误" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters