AMR 转mp3 失败

    private void changeToMp3(String sourcePath) {
        File source = new File(sourcePath);

        String mp3TargetPath = sourcePath.substring(0, sourcePath.lastIndexOf(".")) + ".mp3";
        LOG.debug("MP3 - file path = " + mp3TargetPath);

        File target = new File(mp3TargetPath);

        AudioAttributes audio = new AudioAttributes();
        Encoder encoder = new Encoder();
        // pcm_s16le libmp3lame libvorbis libfaac
        audio.setCodec("libmp3lame");
        EncodingAttributes attrs = new EncodingAttributes();
        attrs.setFormat("mp3");
        attrs.setAudioAttributes(audio);

        /*
        AudioAttributes audio = new AudioAttributes();
        Encoder encoder = new Encoder();

        audio.setBitRate(new Integer(128000));
        audio.setChannels(new Integer(2));
        audio.setSamplingRate(new Integer(44100));
        audio.setCodec("libmp3lame");

        EncodingAttributes attrs = new EncodingAttributes();
        attrs.setFormat("mp3");
        attrs.setAudioAttributes(audio);
        attrs.setDuration(3f);
        */
        /*try {
            attrs.setDuration(getAmrDuration(source));
        } catch (IOException e) {
            LOG.error(e.getMessage(), e);
        }
         */
        try {
            encoder.encode(source, target, attrs);
        } catch (IllegalArgumentException e) {
            LOG.error(e.getMessage(), e);
        } catch (InputFormatException e) {
            LOG.error(e.getMessage(), e);
        } catch (EncoderException e) {
            LOG.error(e.getMessage(), e);
        }
    }

2015-06-10 01:16:12 DispatcherServlet 843 [DEBUG] DispatcherServlet with name ‘mainServlet‘ processing POST request for [/pp/profile/saveVisualizationConfig.do]
2015-06-10 01:16:12 RequestMappingHandlerMapping 222 [DEBUG] Looking up handler method for path /profile/saveVisualizationConfig.do
2015-06-10 01:16:12 RequestMappingHandlerMapping 229 [DEBUG] Returning handler method [public java.lang.String com.wp.pp.web.controller.TemplateConfigController.saveVisualizationConfig(org.springframework.ui.Model,java.lang.String,java.lang.String,java.lang.String,java.lang.String)]
2015-06-10 01:16:12 DefaultListableBeanFactory 249 [DEBUG] Returning cached instance of singleton bean ‘templateConfigController‘
2015-06-10 01:16:12 TemplateConfigController 594 [DEBUG] userName = ???
2015-06-10 01:16:12 TemplateConfigController 595 [DEBUG] userId = 808809b1-6a66-4839-b619-7aaea276b995
2015-06-10 01:16:12 TemplateConfigController 596 [DEBUG] phtotServerId =
2015-06-10 01:16:12 TemplateConfigController 597 [DEBUG] voiceServerId = PAtgTHiF5Yc9rWSTdViBlkRxSag8LoQ5uQZVsw6yRxPkTQjSjQvlNQRwkdvLzyw3
2015-06-10 01:16:12 SharedEntityManagerCreator$SharedEntityManagerInvocationHandler 248 [DEBUG] Creating new EntityManager for shared EntityManager invocation
2015-06-10 01:16:12 SessionImpl 316 [DEBUG] Opened session at timestamp: 14338701722
2015-06-10 01:16:12 CriteriaQueryCompiler 219 [DEBUG] Rendered criteria query -> select generatedAlias0 from User as generatedAlias0 where generatedAlias0.userId=:param0
2015-06-10 01:16:12 LogicalConnectionImpl 295 [DEBUG] Obtaining JDBC connection
2015-06-10 01:16:12 LogicalConnectionImpl 301 [DEBUG] Obtained JDBC connection
2015-06-10 01:16:12 SQL 104 [DEBUG] select user0_.userId as userId9_, user0_.email as email9_, user0_.fullPhotoUrl as fullPhot3_9_, user0_.goodByAudioServerId as goodByAu4_9_, user0_.goodByeAudioUrl as goodByeA5_9_, user0_.introduceAudioUrl as introduc6_9_, user0_.isSubScribe as isSubScr7_9_, user0_.lastUpdateAt as lastUpda8_9_, user0_.likeNumers as likeNumers9_, user0_.mobile as mobile9_, user0_.profileStatus as profile11_9_, user0_.profileStyle as profile12_9_, user0_.qqAccount as qqAccount9_, user0_.readTimes as readTimes9_, user0_.registerOn as registerOn9_, user0_.smallPhotoUrl as smallPh16_9_, user0_.subscribeOn as subscri17_9_, user0_.unsubscribeOn as unsubsc18_9_, user0_.userName as userName9_, user0_.weChatAccount as weChatA20_9_, user0_.weChatCity as weChatCity9_, user0_.weChatHeadImgUrl as weChatH22_9_, user0_.weChatNickName as weChatN23_9_, user0_.weChatOpenId as weChatO24_9_, user0_.weChatProvince as weChatP25_9_, user0_.weChatSex as weChatSex9_ from User user0_ where user0_.userId=?
2015-06-10 01:16:12 Loader 849 [DEBUG] Result set row: 0
2015-06-10 01:16:12 Loader 1344 [DEBUG] Result row: EntityKey[com.wp.pp.model.User#808809b1-6a66-4839-b619-7aaea276b995]
2015-06-10 01:16:12 TwoPhaseLoad 158 [DEBUG] Resolving associations for [com.wp.pp.model.User#808809b1-6a66-4839-b619-7aaea276b995]
2015-06-10 01:16:12 TwoPhaseLoad 297 [DEBUG] Done materializing entity [com.wp.pp.model.User#808809b1-6a66-4839-b619-7aaea276b995]
2015-06-10 01:16:12 StatefulPersistenceContext 947 [DEBUG] Initializing non-lazy collections
2015-06-10 01:16:12 EntityManagerFactoryUtils 435 [DEBUG] Closing JPA EntityManager
2015-06-10 01:16:12 LogicalConnectionImpl 314 [DEBUG] Releasing JDBC connection
2015-06-10 01:16:12 LogicalConnectionImpl 332 [DEBUG] Released JDBC connection
2015-06-10 01:16:12 ConnectionProxyHandler 219 [DEBUG] HHH000163: Logical connection releasing its physical connection
2015-06-10 01:16:12 WeChatSystemConfigService 95 [DEBUG] Get Access Token
2015-06-10 01:16:12 SharedEntityManagerCreator$SharedEntityManagerInvocationHandler 248 [DEBUG] Creating new EntityManager for shared EntityManager invocation
2015-06-10 01:16:12 SessionImpl 316 [DEBUG] Opened session at timestamp: 14338701723
2015-06-10 01:16:12 CriteriaQueryCompiler 219 [DEBUG] Rendered criteria query -> select generatedAlias0 from WeChatSystemConfig as generatedAlias0 where generatedAlias0.configItem=:param0
2015-06-10 01:16:12 LogicalConnectionImpl 295 [DEBUG] Obtaining JDBC connection
2015-06-10 01:16:12 LogicalConnectionImpl 301 [DEBUG] Obtained JDBC connection
2015-06-10 01:16:12 SQL 104 [DEBUG] select wechatsyst0_.id as id12_, wechatsyst0_.configItem as configItem12_, wechatsyst0_.configValue as configVa3_12_, wechatsyst0_.lastConfigAt as lastConf4_12_, wechatsyst0_.remark as remark12_ from WeChatSystemConfig wechatsyst0_ where wechatsyst0_.configItem=? limit ?
2015-06-10 01:16:12 Loader 849 [DEBUG] Result set row: 0
2015-06-10 01:16:12 Loader 1344 [DEBUG] Result row: EntityKey[com.wp.pp.model.WeChatSystemConfig#611a33fb-eb10-47eb-8941-a215f663359e]
2015-06-10 01:16:12 TwoPhaseLoad 158 [DEBUG] Resolving associations for [com.wp.pp.model.WeChatSystemConfig#611a33fb-eb10-47eb-8941-a215f663359e]
2015-06-10 01:16:12 TwoPhaseLoad 297 [DEBUG] Done materializing entity [com.wp.pp.model.WeChatSystemConfig#611a33fb-eb10-47eb-8941-a215f663359e]
2015-06-10 01:16:12 StatefulPersistenceContext 947 [DEBUG] Initializing non-lazy collections
2015-06-10 01:16:12 EntityManagerFactoryUtils 435 [DEBUG] Closing JPA EntityManager
2015-06-10 01:16:12 LogicalConnectionImpl 314 [DEBUG] Releasing JDBC connection
2015-06-10 01:16:12 LogicalConnectionImpl 332 [DEBUG] Released JDBC connection
2015-06-10 01:16:12 ConnectionProxyHandler 219 [DEBUG] HHH000163: Logical connection releasing its physical connection
2015-06-10 01:16:12 WeChatSystemConfigService 98 [DEBUG] Found 1 valid cache Access Token: DXY1gQD_EuemxX6TVEPTva52tXjTYSPbTglhgjAOUWV_oa2KZTgqWN_Y1Ps0asHKpMYtWmD0xB5qgQNsfkD_T44onQ-WFwt8pDeHRCsmNHU
2015-06-10 01:16:12 FileService 134 [DEBUG] fileName = PAtgTHiF5Yc9rWSTdViBlkRxSag8LoQ5uQZVsw6yRxPkTQjSjQvlNQRwkdvLzyw3.amr
2015-06-10 01:16:12 FileService 150 [DEBUG] ==============================
2015-06-10 01:16:12 FileService 151 [DEBUG] Voice file absolute path = /var/lib/tomcat/pp/media/o-d71s3oI_IoBZAzJoIvqMleeQVg/PAtgTHiF5Yc9rWSTdViBlkRxSag8LoQ5uQZVsw6yRxPkTQjSjQvlNQRwkdvLzyw3.amr
2015-06-10 01:16:12 FileService 153 [DEBUG] mp3TargetPath file absolute path = /var/lib/tomcat/pp/media/o-d71s3oI_IoBZAzJoIvqMleeQVg/PAtgTHiF5Yc9rWSTdViBlkRxSag8LoQ5uQZVsw6yRxPkTQjSjQvlNQRwkdvLzyw3.mp3
2015-06-10 01:16:12 FileService 154 [DEBUG] ==============================
2015-06-10 01:16:12 FileService 182 [DEBUG] MP3 - file path = /var/lib/tomcat/pp/media/o-d71s3oI_IoBZAzJoIvqMleeQVg/PAtgTHiF5Yc9rWSTdViBlkRxSag8LoQ5uQZVsw6yRxPkTQjSjQvlNQRwkdvLzyw3.mp3
2015-06-10 01:16:12 FileService 210 [ERROR]   Duration: N/A, bitrate: N/A
it.sauronsoftware.jave.EncoderException:   Duration: N/A, bitrate: N/A
        at it.sauronsoftware.jave.Encoder.encode(Encoder.java:863)
        at it.sauronsoftware.jave.Encoder.encode(Encoder.java:713)
        at com.wp.pp.service.FileService.changeToMp3(FileService.java:204)
        at com.wp.pp.service.FileService.downloadFile(FileService.java:156)
        at com.wp.pp.web.controller.TemplateConfigController.downloadMedia(TemplateConfigController.java:803)
        at com.wp.pp.web.controller.TemplateConfigController.saveVisualizationConfig(TemplateConfigController.java:609)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:622)
        at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:214)
        at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
        at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:748)
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689)
        at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:945)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:876)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:931)
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:833)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:807)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:931)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:701)
2015-06-10 01:16:12 TemplateConfigController 804 [DEBUG] fileName = PAtgTHiF5Yc9rWSTdViBlkRxSag8LoQ5uQZVsw6yRxPkTQjSjQvlNQRwkdvLzyw3.amr
2015-06-10 01:16:12 TemplateConfigController 610 [DEBUG] voiceUrl = /media/o-d71s3oI_IoBZAzJoIvqMleeQVg/PAtgTHiF5Yc9rWSTdViBlkRxSag8LoQ5uQZVsw6yRxPkTQjSjQvlNQRwkdvLzyw3.amr
2015-06-10 01:16:12 DefaultListableBeanFactory 249 [DEBUG] Returning cached instance of singleton bean ‘transactionManager‘
2015-06-10 01:16:12 JpaTransactionManager 367 [DEBUG] Creating new transaction with name [com.wp.pp.service.VisualizationConfigService.save]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT; ‘‘
2015-06-10 01:16:12 SessionImpl 316 [DEBUG] Opened session at timestamp: 14338701724
2015-06-10 01:16:12 JpaTransactionManager 371 [DEBUG] Opened new EntityManager [org.hibernate.ejb.EntityMana[email protected]] for JPA transaction
2015-06-10 01:16:12 AbstractTransactionImpl 158 [DEBUG] begin
2015-06-10 01:16:12 LogicalConnectionImpl 295 [DEBUG] Obtaining JDBC connection
2015-06-10 01:16:12 LogicalConnectionImpl 301 [DEBUG] Obtained JDBC connection
2015-06-10 01:16:12 JdbcTransaction 69 [DEBUG] initial autocommit status: true
2015-06-10 01:16:12 JdbcTransaction 71 [DEBUG] disabling autocommit
2015-06-10 01:16:12 JpaTransactionManager 403 [DEBUG] Exposing JPA transaction as JDBC transaction [org.springframewo[email protected]49626430]
2015-06-10 01:16:12 DefaultListableBeanFactory 249 [DEBUG] Returning cached instance of singleton bean ‘transactionManager‘
2015-06-10 01:16:12 JpaTransactionManager 334 [DEBUG] Found thread-bound EntityManager [[email protected]] for JPA transaction
2015-06-10 01:16:12 JpaTransactionManager 472 [DEBUG] Participating in existing transaction
2015-06-10 01:16:12 Loader 2021 [DEBUG] Loading entity: [com.wp.pp.model.User#808809b1-6a66-4839-b619-7aaea276b995]
2015-06-10 01:16:12 SQL 104 [DEBUG] select user0_.userId as userId9_0_, user0_.email as email9_0_, user0_.fullPhotoUrl as fullPhot3_9_0_, user0_.goodByAudioServerId as goodByAu4_9_0_, user0_.goodByeAudioUrl as goodByeA5_9_0_, user0_.introduceAudioUrl as introduc6_9_0_, user0_.isSubScribe as isSubScr7_9_0_, user0_.lastUpdateAt as lastUpda8_9_0_, user0_.likeNumers as likeNumers9_0_, user0_.mobile as mobile9_0_, user0_.profileStatus as profile11_9_0_, user0_.profileStyle as profile12_9_0_, user0_.qqAccount as qqAccount9_0_, user0_.readTimes as readTimes9_0_, user0_.registerOn as registerOn9_0_, user0_.smallPhotoUrl as smallPh16_9_0_, user0_.subscribeOn as subscri17_9_0_, user0_.unsubscribeOn as unsubsc18_9_0_, user0_.userName as userName9_0_, user0_.weChatAccount as weChatA20_9_0_, user0_.weChatCity as weChatCity9_0_, user0_.weChatHeadImgUrl as weChatH22_9_0_, user0_.weChatNickName as weChatN23_9_0_, user0_.weChatOpenId as weChatO24_9_0_, user0_.weChatProvince as weChatP25_9_0_, user0_.weChatSex as weChatSex9_0_ from User user0_ where user0_.userId=?
2015-06-10 01:16:12 Loader 849 [DEBUG] Result set row: 0
2015-06-10 01:16:12 Loader 1344 [DEBUG] Result row: EntityKey[com.wp.pp.model.User#808809b1-6a66-4839-b619-7aaea276b995]
2015-06-10 01:16:12 TwoPhaseLoad 158 [DEBUG] Resolving associations for [com.wp.pp.model.User#808809b1-6a66-4839-b619-7aaea276b995]
2015-06-10 01:16:12 TwoPhaseLoad 297 [DEBUG] Done materializing entity [com.wp.pp.model.User#808809b1-6a66-4839-b619-7aaea276b995]
2015-06-10 01:16:12 StatefulPersistenceContext 947 [DEBUG] Initializing non-lazy collections
2015-06-10 01:16:12 Loader 2045 [DEBUG] Done entity load
2015-06-10 01:16:12 DefaultListableBeanFactory 249 [DEBUG] Returning cached instance of singleton bean ‘transactionManager‘
2015-06-10 01:16:12 JpaTransactionManager 334 [DEBUG] Found thread-bound EntityManager [[email protected]] for JPA transaction
2015-06-10 01:16:12 JpaTransactionManager 472 [DEBUG] Participating in existing transaction
2015-06-10 01:16:12 CriteriaQueryCompiler 219 [DEBUG] Rendered criteria query -> select generatedAlias0 from VisualizationConfig as generatedAlias0 where generatedAlias0.userId=:param0
2015-06-10 01:16:12 AbstractFlushingEventListener 143 [DEBUG] Processing flush-time cascades
2015-06-10 01:16:12 AbstractFlushingEventListener 183 [DEBUG] Dirty checking collections
2015-06-10 01:16:12 AbstractFlushingEventListener 117 [DEBUG] Flushed: 0 insertions, 1 updates, 0 deletions to 1 objects
2015-06-10 01:16:12 AbstractFlushingEventListener 124 [DEBUG] Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
2015-06-10 01:16:12 EntityPrinter 114 [DEBUG] Listing entities:
2015-06-10 01:16:12 EntityPrinter 121 [DEBUG] com.wp.pp.model.User{unsubscribeOn=2015-06-02 23:45:35.0, weChatOpenId=o-d71s3oI_IoBZAzJoIvqMleeQVg, weChatNickName=???, registerOn=null, introduceAudioUrl=null, readTimes=0, profileStatus=draft, userId=808809b1-6a66-4839-b619-7aaea276b995, subscribeOn=2015-06-02 23:45:57.0, userName=???, fullPhotoUrl=null, goodByAudioServerId=0i7ReActqOPa45BxDRrypUpByBziGazkqDJSAmdg-1Cj3bIWfL5FZ4xgduiRPiEQ, weChatCity=??, lastUpdateAt=Wed Jun 10 01:16:12 CST 2015, likeNumers=92, weChatProvince=??, email=2, weChatSex=1, isSubScribe=true, weChatAccount=3, goodByeAudioUrl=/media/o-d71s3oI_IoBZAzJoIvqMleeQVg/0i7ReActqOPa45BxDRrypUpByBziGazkqDJSAmdg-1Cj3bIWfL5FZ4xgduiRPiEQ.amr, weChatHeadImgUrl=http://wx.qlogo.cn/mmopen/YUnE7hjiaRfC0RcRhAnUlKlwqia6VWT2pbwG14kArVjr67w5A1mnbG9w25WMDFCxSz6tO9QKr8WgzUXgwzLgKJNjGdQd4NnIGp/0, profileStyle=black, smallPhotoUrl=/media/o-d71s3oI_IoBZAzJoIvqMleeQVg/head.png?rand=139d2d49-1801-4bcc-b74b-ad772a0e4dcf, qqAccount=666, mobile=13510902180}
2015-06-10 01:16:12 SQL 104 [DEBUG] select visualizat0_.id as id11_, visualizat0_.lastUpdateAt as lastUpda2_11_, visualizat0_.photoUrl as photoUrl11_, visualizat0_.photoWeChatServerId as photoWeC4_11_, visualizat0_.userId as userId11_, visualizat0_.voiceUrl as voiceUrl11_, visualizat0_.voiceWeChatServerId as voiceWeC7_11_ from VisualizationConfig visualizat0_ where visualizat0_.userId=? limit ?
2015-06-10 01:16:12 Loader 849 [DEBUG] Result set row: 0
2015-06-10 01:16:12 Loader 1344 [DEBUG] Result row: EntityKey[com.wp.pp.model.VisualizationConfig#f6eda01e-b819-4ada-a1c5-5c31feb865d3]
2015-06-10 01:16:12 TwoPhaseLoad 158 [DEBUG] Resolving associations for [com.wp.pp.model.VisualizationConfig#f6eda01e-b819-4ada-a1c5-5c31feb865d3]
2015-06-10 01:16:12 TwoPhaseLoad 297 [DEBUG] Done materializing entity [com.wp.pp.model.VisualizationConfig#f6eda01e-b819-4ada-a1c5-5c31feb865d3]

  

时间: 2024-12-21 09:17:10

AMR 转mp3 失败的相关文章

java实现windows下amr转换为mp3(可实现微信语音和qq语音转换)

最近做一个项目需要将微信的语音文件放在页面进行播放,查了好多资料发现,web页面直接播放并没有一个好的解决方案,于是就想到了先将amr文件转换成易于在页面播放的mp3文件,然后在进行播放,现在将amr文件转化为mp3文件的几种方式以及踩过的坑分享一下: 查了好多资料,总结一下,amr转换mp3的方式有如下几种: 1.通过jave.jar包实现(不可以转微信及qq语音文件): 我用的是:jave-1.0.2.zip jave.jar包官方下载 2.通过ffmpeg.exe实现(不可以转微信及qq语

部署ffmpeg及amr转mp3方法

简介:FFmpeg是一套可以用来记录.转换数字音频.视频,并能将其转化为流的开源计算机程序:更多介绍请自行百度 环境Centos6.7 编译器:gcc 安装步骤: 1步:安装依赖环境 yum install -y  yasm automake autoconf libtool gcc gcc-c++ 2步:下载源码包, cd  /usr/local/src wget http://jaist.dl.sourceforge.net/project/lame/lame/3.99/lame-3.99.

redhat编译静态ffmpeg实现amr转MP3

最近项目里有和app对接,要把ios传过来的amr录音在web上播放.一开始找了苹果的quickTime,各种奇怪没法用,而且官网上好像不能下载了,干脆后台转成MP3.同事找到了一个java的封装jave.jar. 在window上是可以转的,到linux上不行了. 我看了下jave的官网,这是个对ffmpeg的封装,刚好以前玩R语言的时候用过ffmpeg.官网说法是,jar包里的ffmpeg.exe和ffmpeg可执行程序是随便编译的给32位系统用的,所以实际上需要自己提供ffmpeg的可执行

.net 音频转换 .amr 转 .mp3 (ffmpeg转换法)

最近看来是跟声音干上了啊! 音频转换的第二种方法,这种方法相对第一种来说,要简单的多! 首先,你得下载个“ffmpeg.exe” 插件,然后把它放到你的项目中,如下图: 程序中会调用该文件,以助于转换音频格式! 上代码: using System; using System.Threading; using System.IO; using System.Diagnostics; using System.Security; public partial class cowala_201512C

.net 音频转换 .amr 转 .mp3 (方法一)

.amr 用于移动设备的音频,压缩比比较大,多用于人声.通话,效果还行!所以,移动设备多采用amr格式来进行储存录!比较常见的例子:微信录音! 这个鬼,用两个字来形容,就是“蛋疼”:因为HTML5压根就不支持它(amr:我是个<孤儿> ,导演:佐米·希尔拉):所以,试听效果也就很难实现了!虽然微信是提供试听的,但一旦离开了页面,那就意味着,你再也无法播放你的录音了! 所以你不得不将文件转换下格式! 目前,小编掌握的转换格式的方法有两种:一是上传到七牛云服务进行转换下载:二是通过ffmpeg 应

amr转MP3

using System; using System.Threading; using System.IO; using System.Diagnostics; using System.Security; public partial class cowala_201512Chritmas_amrtest : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack)

解决linux AMR转MP3出现转码成功却无法播放的问题

根据帖子:的提示,在linux安装ffmpeg,确实在linux下使用命令可以将amr转成mp3,并且可以进行播放,不过使用编译的jave-1.0.2.jar进行转化的时候,目录下生成了 http://pic.cnhubei.com/space.php?uid=1079&do=album&id=824989http://pic.cnhubei.com/space.php?uid=1079&do=album&id=824960http://pic.cnhubei.com/sp

php自定义函数: amr转mp3格式

<?php function amr2mp3($file){ if (file_exists($file . '.mp3') == true) { return; } else { $params = "-ab 256 -ar 16000 -ac 1 -vol 200";//16000 高质量 $command = "/usr/local/bin/ffmpeg -i $file.amr $params $file.mp3"; system($command,

ffmpeg centos6.5上安装(测试 amr 转换为 mp3)

1. 下载相关源码包 wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz wget http://sourceforge.net/projects/lame/files/lame/3.99/lame-3.99.5.tar.gz/download wget http://sourceforge.net/projects/opencore-amr/files/opencore-amr/opencore-amr-0.