最适合在智能手机中播放音频文件的文件格式
我有一个网络应用程序(jsp/servlet),允许用户下载音频文件并在手机中播放。为了瞄准大量受众,我希望为普通智能手机开发一个j2me应用程序。我的音频文件是录音,可能会持续 50 分钟左右。因此,一个非常轻量级的音频文件应该可供用户在我的移动应用程序中下载和播放。J2ME 应用程序可以通过 http 访问音频文件(因为大多数手机支持 http 而不是 rtsp)。我的问题是
1.哪种音频文件格式最适合在更多智能手机(诺基亚、索尼爱立信、摩托罗尔等)上运行并且下载重量最轻? (据我所知mp3很好,但是更多手机支持mp3吗?)
2.我如何在servlet中编码大音频文件(开源编解码器和那些编码的音频文件必须在j2me应用程序中播放:- Manager.createPlayer(url)轻松,请提供任何示例代码或源)
我的目标是允许用户下载大约 5mb 的文件,可能运行大约 50 分钟。我不知道是否可能。如果有人知道,请告诉我我的问题的答案。
I have a web app(jsp/servlets) which allows users to download audio files and play in mobile phones.For targeting a large audience, I wish to develop a j2me app for normal smart phones. My audio files are voice recordings and may run for around 50 minutes. Therefore a very light weight audio files should be available for users to download and play in my mobile app.J2ME app may reach audio files through http(as most phones support http than rtsp).My questions are
1.What is the most suitable audio file format which will run in more smart mobile phones(Nokia,SonyErricsson,Motoroal etc) and most light weight for downloading? (As I know mp3 is good,but are more phones support for mp3?)
2. How I can encode big audio files in servlets(Open source Codecs and those encoded audio files must be play in j2me app:- Manager.createPlayer(url) easily, any sample code or sources please)
My aim is to allow users to download around 5mb files which may run around 50 minutes.I don't whether it is possible or not. if any one knows,please let me know answers for my problems.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Manager
类允许您测试设备是否支持 mp3。大多数最新的 JavaME 设备都支持,但无论如何您都应该检查一下,因为保证支持的唯一音频格式是 wav。至于最好的,我想就你而言,最好的就是转移最快的。您应该以可接受的最低质量创建文件(例如:单声道而不是立体声,低比特率而不是高比特率等)。由于您使用的是语音而不是音乐,因此您并不真正需要 44.1 kHz 立体声 CD 质量。
编辑:
但是,我认为您不能通过 HTTP 在 JavaME 中传输音频。
Player.prefetch
方法将在播放前尝试下载整个文件,而 50 MB 对于 JavaME 等内存受限设备来说太大了。如果您的设备支持,则必须使用 RSTP;或者使用createPlayer
方法的DataSource
版本,并实现DataSource
以从 HTTP 返回常规InputStream
连接到您的文件。The
Manager
class allows you to test if mp3 is supported in the device. Most recent JavaME devices do, but you should check anyway as the only audio format guaranteed to be supported is wav.As for the best, in your case the best is the fastest to transfer, I guess. You should create the file with the minimum acceptable quality possible (e.g.: mono instead of stereo, low bitrate instead of high, etc). Since you are working with voice instead of music, you don't really need 44.1 kHz stereo CD quality.
EDIT:
However, I don't think you can stream audio in JavaME over HTTP. The
Player.prefetch
method will try to download the entire file before playing, and 50 MB is just too much for memory constrained devices like JavaME ones. You have to use RSTP if your device supports it; or use theDataSource
version of thecreatePlayer
method, and implement aDataSource
to return a regularInputStream
from an HTTP connection to your file.