Use seven kn to turn AMR format recordings into MP3 format, prompting the file to be corrupted

Source: Internet
Author: User
刚开始用七牛,把一个amr音频转mp3,用的是php的sdk。这段程序执行完后bucket里面是有生成了999.mp3,但是下载到本地用jplayer放,提示无法解码。用firefox浏览器直接打开,提示文件已损坏。请教高手。摘选了一段主要的代码是这样的:
$auth = new Auth($accessKey, $secretKey);// 要上传的空间$bucket = 'mp3url';//执行的格式转换$pfopOps = "avthumb/mp3/ab/64k/ar/22050"; $policy = array(    'persistentOps' => $pfopOps,    'persistentNotifyUrl' => 'http://',);// 生成上传 Token$token = $auth->uploadToken($bucket);// 要上传文件的本地路径$filePath = './20150504121658533.amr';// 上传到七牛后保存的文件名$key = '999.mp3';// 初始化 UploadManager 对象并进行文件的上传。$uploadMgr = new UploadManager();list($ret, $err) = $uploadMgr->putFile($token, $key, $filePath);echo "\n====> putFile result: \n";if ($err !== null) {    var_dump($err);} else {    var_dump($ret);}

Reply content:

刚开始用七牛,把一个amr音频转mp3,用的是php的sdk。这段程序执行完后bucket里面是有生成了999.mp3,但是下载到本地用jplayer放,提示无法解码。用firefox浏览器直接打开,提示文件已损坏。请教高手。摘选了一段主要的代码是这样的:
$auth = new Auth($accessKey, $secretKey);// 要上传的空间$bucket = 'mp3url';//执行的格式转换$pfopOps = "avthumb/mp3/ab/64k/ar/22050"; $policy = array(    'persistentOps' => $pfopOps,    'persistentNotifyUrl' => 'http://',);// 生成上传 Token$token = $auth->uploadToken($bucket);// 要上传文件的本地路径$filePath = './20150504121658533.amr';// 上传到七牛后保存的文件名$key = '999.mp3';// 初始化 UploadManager 对象并进行文件的上传。$uploadMgr = new UploadManager();list($ret, $err) = $uploadMgr->putFile($token, $key, $filePath);echo "\n====> putFile result: \n";if ($err !== null) {    var_dump($err);} else {    var_dump($ret);}

Add, my Amr file about 5kb or so, is the recording

Did you solve the problem? I've had this problem, too, begging for help.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.