Changing audio file in Blackberry
I have some audio files of different types -- .mp3, .amr -- saved on my BlackBerry and I want to开发者_运维知识库 alter them. I want to make the music or voice recorded sound different.
What can I do to change the audio? Maybe get the file as a stream of bytes and change them byte by byte? Is it possible? Any other suggestions?
If you mean alter by mixing different media files then you can take the following code. Second sond file will play only if your device support mixing. First file is the main sound file. Second one is usually a small duration sound effect file.
Player musicPl = Manager.createPlayer("file:///SDCard/BlackBerry/Music/musicfile.mp3");
Player soundPl = Manager.createPlayer("file:///SDCard/BlackBerry/Music/soundfile.amr");
musicPl.realize();
soundPl.realize();
musicPl.start();
if (System.getProperty("supports.mixing").equals("true"))
{
for (int i = 0; i < 10; ++i)
{
soundPl.start();
Thread.sleep(500);
soundPl.stop();
}
}
NOTE:- Above sample will not alter any file. Just mix multiple sound file.
No such APIs were found. Maybe something from other j2me platforms could be ported but for bb such framework is not currently available.
精彩评论