如何连接code一个WAV到MP3一个Android设备上 [英] How to encode a WAV to a mp3 on a Android device

查看:132
本文介绍了如何连接code一个WAV到MP3一个Android设备上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我简化了我的问题,并提出了赏金: 什么选择在那里为COM pressing原始的PCM音频数据到MP3一个Android设备上。

I'm simplified my question and offered a bounty: What options are there for compressing raw PCM audio data to a mp3 on a Android device.

我的原帖: 我创建我的Andr​​oid手机合成器,我已经产生PCM数据发送到扬声器。现在,我想知道如果我能恩code这个PCM数据作为一个MP3保存到SD卡。该 MediaRecorder 对象可以连接code声音从麦克风到各种格式的到来,但没有按'T允许程序生成的音频数据的编码。

My original post: I'm creating a synthesiser on my Android phone, and I've been generating PCM data to send to the speakers. Now I'm wondering if I can encode this PCM data as a mp3 to save to the sdcard. The MediaRecorder object can encode audio coming from the microphone into various formats, but doesn't allow the encoding from programmatically generated audio data.

所以我的问题是,是否有音频编码标准的Andr​​oid API?如果不是,什么纯Java或NDK的解决方案有哪些?你能不能推荐其中任何?

So my question is, is there a standard Android API for encoding audio? If not, what pure Java or NDK based solutions are there? And can you recommend any of them?

如果做不到这一点我就必须要救我生成的音频为WAV文件,我可以很容易做到。

Failing this I'll just have to save my generated audio as a WAV file, which I can easily do.

推荐答案

纯Java
看看Tritonus的无尘室实施javasound的它提供了一个 MP3连接codeR 的插件在这里: HTTP:/ /www.tritonus.org/plugins.html
其次,我会建议寻找到jzoom的图书馆JLayer或JLayerME:<一href="http://www.javazoom.net/javalayer/javalayer.html">http://www.javazoom.net/javalayer/javalayer.html (这可能只是去code,不知道)
如果这些不适合你的需要,你可以看一下这篇文章从2000年约增加MP3功能,J2SE(附源码):<一href="http://www.javaworld.com/javaworld/jw-11-2000/jw-1103-mp3.html">http://www.javaworld.com/javaworld/jw-11-2000/jw-1103-mp3.html

本机的路由
如果你想原生的表现我想看看一个FFmpeg的或跛脚端口为Android。 拉梅: http://lame.sourceforge.net/

Pure Java
Look into Tritonus's clean room implementation of javasound which offers an MP3 encoder plugin here: http://www.tritonus.org/plugins.html
Secondly, I would suggest looking into jzoom's libraries JLayer or JLayerME: http://www.javazoom.net/javalayer/javalayer.html (this may only be decode, not sure)
If those doesn't suit your need you can look at this article from 2000 about adding MP3 capabilities to J2SE (with source): http://www.javaworld.com/javaworld/jw-11-2000/jw-1103-mp3.html

Native route
If you want "native" performance I would look at an FFmpeg or Lame port for Android. Lame: http://lame.sourceforge.net/

这篇关于如何连接code一个WAV到MP3一个Android设备上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆