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
Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: Play 2 sounds on Storm 9520, why it's not possible ???

Probably but I am busy doing some other nontrivial tasks.

 

If I did I probably would want it to be real time (that's the only way it is actually useful for games), in my head I imagine it would probably require a custom InputStream that would have the mixer either built in or as a type that could be passed into the constructor or a set function. Then when bytes are to be read it would mix the audio and return the mixed audio. It would probably be horribly laggy but it would be something.

---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.
Developer
Posts: 709
Registered: ‎09-10-2009
My Device: 8520, 8900, 9000, 9300, 9650, 9700, 9780, 9800, 9810, 9900, 9930
My Carrier: Verizon

Re: Play 2 sounds on Storm 9520, why it's not possible ???

That is not difficult to do if the streams are encoded in a simple format, like linear.

 

Just want to give you a heads up if you ever want to do this. Another challege is manage the buffering of the player in real time.  Especially when the playing is interrupted by a call as the call might throw the timing of the player out of wack. I have managed to take care all that for a different type of application. It is more art than science.

New Developer
Posts: 2
Registered: ‎12-15-2009
My Device: Not Specified

Re: Play 2 sounds on Storm 9520, why it's not possible ???

So, still no answers from RIM developers....

 

We decided not to play background music, only sound effects,

BlackBerry isn't good platform to make a great games and it's a pity

Developer
Posts: 275
Registered: ‎03-10-2009
My Device: Not Specified

Re: Play 2 sounds on Storm 9520, why it's not possible ???

Hi,

 

I have a question regarding the background music in the game. I am currently using Player and its Player.setLoop(-1) method to loop a short mp3 over and over as background music. However, there is a slight but noticeable lag when the song loops back to the beginning. Is it the same case with yours? Any idea how to solve this?

 

Thanks

Highlighted
Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: Play 2 sounds on Storm 9520, why it's not possible ???

I've encountered the same problem (on a non-Storm platform). They only way I managed to solve the issue was to create an InputStream stream that loops the audio (then pass the InputStream to the Player), so that the Player doesn't have to loop it. In this case there's no delay between the iterations of the loop. I would be interested to learn if there's a cleaner solution.