If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
cyork2
Posts: 34
Registered: ‎02-28-2010
My Device: 8800
My Carrier: at&t
Accepted Solution

$ paid for AMR-NB converter (to raw or PCM data)

I need raw audio data and many BlackBerry phones don't support PCM.  I am working on this as a side project but am willing to pay for working code.  Prefer code that supports JDE 4.2.1 and later.

 

Contact by email if you are interested.

cyork2@gmail.com

Please use plain text.
Developer
Aviator168
Posts: 709
Registered: ‎09-10-2009
My Device: 8520, 8900, 9000, 9300, 9650, 9700, 9780, 9800, 9810, 9900, 9930
My Carrier: Verizon

Re: $ paid for AMR-NB converter (to raw or PCM data)

Is C/C++ source ok for you?

 

http://s.pudn.com/search_hot_en.asp?k=amr#

Please use plain text.
Contributor
cyork2
Posts: 34
Registered: ‎02-28-2010
My Device: 8800
My Carrier: at&t

Re: $ paid for AMR-NB converter (to raw or PCM data)

Thanks.. I grabbed an ANSI C version and 40 hours of cursing later I have a Java version of the decoder.  Only problem is that right now decoding a 10 second audio clip takes 10 seconds.

 

Craig

Please use plain text.
Developer
marchywka
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: $ paid for AMR-NB converter (to raw or PCM data)

Performance optimization of media processing can be interesting. I recall I was able to get an 8ksps ACELP running on an old Nokia 6620 but can't remember if it could keep up.

Anyway, generally with java getting this kind of code to run faster is not obvious- even things like bit operations ( shifts) add up and definitely divisions are out.

Reference implemntations want to be illustrative, not optimized. Often lookup tables

help, deferring some operations, like divisions, can be important. Floating point in this setting is questionable.

 

Please use plain text.
Developer
rcmaniac25
Posts: 1,804
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.2174, Z10 (STL100-3)-10.3.0.700 Dev OS, Z30 (STA100-5)-10.3.0.700 Dev OS, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: $ paid for AMR-NB converter (to raw or PCM data)

I remember someone did some performance tests and said that even with the conversion to and from Fixed point you still get much better performance doing that then using floats. Someone else found that ints are fastest, followed by the other integer types, then float, then double.

 

Remove function calls as much as possible, don't do any search loops, hashtables, etc. Also watch out for anything that uses the "new" operator. If it's a class then it allocates the class and remains in memory until you exit the app or set it to null, if it is a primitive (int, byte, etc.) you don't want to make too many of them but they are easy to free and won't cause performance issues.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Please use plain text.
Developer
marchywka
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: $ paid for AMR-NB converter (to raw or PCM data)

Unless the code is real bad there shouldn't be any inner loop OO but people will leave in floating point since it can be hard to scale fixed ( I've done this with ACELP, it is a hassle). Hashtables wouldn't be the first choice if you can use an array LUT but now that you mention it a hash

computation may be cheaper than some other thing, it would be worth considering as a way to save expensive results. Even bit operations can be slow depending on the JVMas they are still in byte codes not always in native code.

 

Inlining is helpful in inner loops certainly. If you are really concerned, it may be worth

finding a reference on the BB memory hierarchy, I'm not even sure if there is one. On

IA-32 anyway preserving locality to maximize lower cache hits is a big deal. Java

doesn't give you much control over memory usage but you may be able to

get some benefits by doing blocks.

 

Please use plain text.
Developer
Aviator168
Posts: 709
Registered: ‎09-10-2009
My Device: 8520, 8900, 9000, 9300, 9650, 9700, 9780, 9800, 9810, 9900, 9930
My Carrier: Verizon

Re: $ paid for AMR-NB converter (to raw or PCM data)

 


cyork2 wrote:

Thanks.. I grabbed an ANSI C version and 40 hours of cursing later I have a Java version of the decoder.  Only problem is that right now decoding a 10 second audio clip takes 10 seconds.

 

Craig


 

There is no problem if it take that long to convert unless you are doing a real time application.

 

Please use plain text.
Contributor
cyork2
Posts: 34
Registered: ‎02-28-2010
My Device: 8800
My Carrier: at&t

Re: $ paid for AMR-NB converter (to raw or PCM data)

Thanks for the tips guys..

 

I'm not doing real time so I'm only going to push so far but a user may record 30 seconds of audio and waiting 30 seconds for an answer from that point is really annoying.  So far I've cut about 30% of the time out by not doing a "perfect' decode (I'm analyzing the data not playing it back so it doesn't have to sound right it just has to reflect amplitude and time basis of the original).

Please use plain text.
Developer
rcmaniac25
Posts: 1,804
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.2174, Z10 (STL100-3)-10.3.0.700 Dev OS, Z30 (STA100-5)-10.3.0.700 Dev OS, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: $ paid for AMR-NB converter (to raw or PCM data)

@marchywka: The only reason I say don't do a hashtable is that, from what I remember reading, Java does hashing incorrectly (compared to pretty much every other OO language) and it ends up being slower then other languages. I expect that for standard APIs RIM uses the publicly available code for J2ME and only optimizes common objects like, well, Object. If they redid everything then it is different but there is no way to find that out unless you work for RIM.

 

Good points though.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Please use plain text.