语音

标签: 语音

小程序语音MP3转WAV

前言 小程序录制的语音格式是aar和mp3, 如果想语音文本识别,像百度语音等SDK要求的都是无损原声pcm格式(wav仅仅是pcm的封装),下面提供两种将mp3转换为wav的方法 0x1通过第三方接口 <?php $url = 'http://server.com/sound.mp3'; $data = json_decode(file_get_contents('http://api.rest7.com/v1/sound_convert.php?url=' . $url . '&format=wav')); if (@$data->success !== 1) { die('Failed'); } $wave = file_get_contents($data->file)

阅读全文...