10-20-2011 05:56 AM
can anybody tell me what are the api's used to create the .wav file from the recorded bytes....... is there any jar files i need to import in my eclipes BB plugin......
Plz if anybody know, reply me....
Actually imporing javaasounddemo(jar) file may work, i didnt try it yet.... but i am facing difficulty in importing jar files to my BB project....
plz any idea, respond me back....
Solved! Go to Solution.
10-20-2011 05:18 PM
This is a very popular ask. So much so that I have added code to do this for you in this knowledge base article
It may take a day or two to show up there, in the meantime the code attachment appears to be accissible (and hopefully the link doesn't change before the revisions I made get published - if it does refer to the KB article I mentioned).
10-21-2011 06:58 AM
thanks for the code u gave me.......
i have amr file(which i get after recording voive note)....which i need to convert to wav file..... i used your code to implement the same..... Since, AudioFormate in fmt header of wav file is 1 for pcm.... but what value should i add foe amr file ..... and do i need to remove header of amr file?
10-21-2011 10:52 AM - edited 10-21-2011 11:48 AM
You won't be able to convert AMR to WAV unless you find or create a decoder. One does not exist with the BB Java API.
EDIT: Correct me if I am wrong, but the KB article BVP showed will have to be altered to get the PCM data stream if it is to work with that PCM > WAV code. PS thanks for the PCM > WAV convertor code, that is very useful.
10-24-2011 12:50 AM
May be u r true.. v cannot convert amr file to wav.... but can u plz tell me can v record voice note in blackberry in pcm formate.... means after recording i can i get pcm file as output..... so that i can try to convert that pcm to wav file,
10-24-2011 01:12 AM
The voice notes application that comes with the device only saves in AMR format, and like I said before to convert it to PCM is tricky on the BB because there is no decoder in the API. You can try searching for specs on how to convert AMR to WAV, but I can't find that information anywhere. You can give it a shot though.
If you want to record a voice note in PCM format you have to make your own code for that. It's easy, use:
capture://audio?encoding=pcm or capture://audio?encoding=audio/basic
as a parameter when you are creating the player and you will get PCM format.
However, devices intended to be used mainly on CDMA networks won't accept that above parameter when you try to make a Player. They crash when you attempt to record the audio in PCM format as they don't come with that functionality.
10-24-2011 02:20 AM
AS in code attached by BVP to convert pcm to wav file,
In wavHeaderAppender the writeUnsignedIntLittleEndian function is not declered in DataParsingUtilities..... So PLz help me what i should i add in place of writeUnsignedIntLittleEndian(long, outputFileStream)......
10-24-2011 04:38 AM
i want to write 32 bit unsigned integer to output stream... DOes anybody knows the code to do so....
public static void writeUnSignedIntLittleEndian(int integer, OutputStream os) throws IOException