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.
The
Managerclass 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.prefetchmethod 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 theDataSourceversion of thecreatePlayermethod, and implement aDataSourceto return a regularInputStreamfrom an HTTP connection to your file.