doumao8803 2013-02-21 04:05
浏览 442
已采纳

如何在上传时将音频转换为“.WAV”格式

I am developing one application where the users can upload audio files to the server by

using any android version in the mobile. By using in built android voice recorder they can

create only .amr format of the audio. But I need audio in the .wav format for some

telephonic use at the server side .

Is there any way in android to create .wav format in built android voice recorder

or at the server end is it possible convert any audio file format to .wav using PHP.

Any help would be thanksfull.

  • 写回答

5条回答 默认 最新

  • dongyan8929 2013-02-28 19:08
    关注

    The best approach would be using FFMPEG as an php extension or you could run ffmpeg directly for converting. The simple way to do using php is:

    <?php exec(ffmpeg -i audio.amr testwav.wav) ?>
    

    But you may encounter some difficulties. So you should add some parameters. You could use "-ar" to set audio sampling rate (in Hz), "-ab" to set audio bit rate (in bits/s) and etc. Below is the sample:

    <?php exec("ffmpeg -i audio.amr -ar 22050 -ab 32 -map_meta_data audio.wav:audio.amr audio.wav"); ?>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥100 求数学坐标画圆以及直线的算法
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 自己瞎改改,结果现在又运行不了了
  • ¥15 链式存储应该如何解决
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站