![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
研电赛
冰菓(笑)
希望写一些有质量的东西
展开
-
ubuntu wav格式音频播放
百度语音合成音频的播放 def play(): pygame.mixer.init(frequency=16000) #加载音乐 pygame.mixer.music.load(r"out.mp3") # while True: # #检查音乐流播放,有返回True,没有返回False #如果没有音乐流则选择播放 if p...原创 2018-07-22 09:32:39 · 765 阅读 · 0 评论 -
快速应用百度语音识别和合成API
#请求使用百度语音接口 aipSpeech = AipSpeech(APP_ID, API_KEY, SECRET_KEY) #语音合成接口 def synthesis(text): # aipSpeech = AipSpeech(APP_ID, API_KEY, SECRET_KEY) result2 = aipSpeech.synthesis(text, 'zh', 1, ...原创 2018-07-22 09:32:15 · 1266 阅读 · 0 评论 -
录制百度语音识别可用的语音
import wave from pyaudio import PyAudio,paInt16 framerate=16000 NUM_SAMPLES=2000 channels=1 sampwidth=2 TIME=2 filename='out.wav' def save_wave_file(filename,data): '''save the date to the wavfile...原创 2018-07-22 09:32:27 · 756 阅读 · 0 评论 -
将Unicode中文字符串转换成 string字符串
# 将Unicode转化为普通Python字符串:"encode" utf8string = unicodestring.encode("utf-8") 将普通Python字符串转化为Unicode:"decode" plainstring1 = unicode(utf8string, "utf-8") ...原创 2018-07-22 09:32:32 · 4800 阅读 · 0 评论