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

Native Development

Reply
Regular Contributor
Posts: 85
Registered: ‎12-12-2011
My Device: PlayBook, Z10
My Carrier: None

playing music and sound effects

Hi,

I was looking at the PlayAudio example, and I wonder if I can use this API to load and play mutiple sound effects or if it is only intended to play a music track in the background or both ?

Thanks!

 

BovioSoft Games
Retired
Posts: 54
Registered: ‎10-26-2011
My Device: Playbook
My Carrier: Rogers

Re: playing music and sound effects

Hi, 

 

The sample application's main purpose was to show how to use the mmrenderer API to play music. 

The sample is similar to the way you would play background music as a part of your application. 

 

In terms of multiple sound effects, I'm not sure what the difference would be.  

I could venture a guess that you would have background music playing in one thread and then short sound effects playing in another thread whenever the user does a special action or accomplishes a specific task.

Is that what you mean?

 

 

Regular Contributor
Posts: 85
Registered: ‎12-12-2011
My Device: PlayBook, Z10
My Carrier: None

Re: playing music and sound effects

Hi anhu, thanks for your reply,

I meant playing sounds effects and background music as in a game.

 

I also saw the PlayWav sample which uses different APIs, so I'm not sure what should be the way to play sound effects and music simultaneously in a game app.

mmrenderer API seems straight forward, so I would like to know if I can use it to play both sounds and music, if not, what should I use ?, mmrenderer for music and the PlayWav routines for sounds ?

Thanks!

 

BovioSoft Games
Retired
Posts: 54
Registered: ‎10-26-2011
My Device: Playbook
My Carrier: Rogers

Re: playing music and sound effects

I see.  

It really just depends on how you want to deploy your background music and sound effects.  It is possible to have your music playing in the background and then then playing other short sound effects when you want anytime during game play.  

 

If you want to keep your sound effects in wav format then you can have your background music playing and follow the PlayWav sample to play the wav files.  This would work and sound as you would normally expect.  

 

Best Regards, 

Anthony

Developer
Posts: 132
Registered: ‎11-06-2012
My Device: BlackBerry Passport

Re: playing music and sound effects

Hi all,

I'm working on a project to seamlessly loop the background music. But currently, I have no idea how to do it. Please help if you have solution.

 

Thanks.