BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 08-08-2010, 12:13 PM   #1
caiaphas
New Member
 
Join Date: Jan 2008
Model: 8800
PIN: N/A
Carrier: Rogers
Posts: 2
Default Can't reliably stop a sound and start another

Please Login to Remove!

I have been having a problem for the last 2 days trying to use the BlackBerry sound API. I've searched all over and can't find an answer.

I have 7 different sounds for a game I'm developing. I understand that the BlackBerry cannot play more than one sound at a time and I'm willing to live with that limitation. I have 7 different Player objects, one for each sound.

What I'm trying to do is interrupt/stop whatever sound is currently playing (if any) and play a different sound. This can happen rapidly depending on what's going on in the game.

There seems to be no reliable way to do this. If I call .stop() on whatever sound I know is currently playing, sometimes it works. Other times, it seems to play half way through the next sound even though I set the media time to 0 each time I play a new sound. Eventually sounds just stop playing altogether and I hear nothing.

I've tried every combination I could think of including adding listeners to keep track of the state of the players. If I use a listener to ensure I never try to play more than one sound at a time, it works but the game experience is not very good. I'd rather interrupt whatever is playing at the time in favor of a new sound but can't do it without weird side effects.

Anyone have a solution?
Offline  
Old 08-12-2010, 01:18 AM   #2
pgoeol
Thumbs Must Hurt
 
Join Date: Sep 2009
Model: 8100
PIN: N/A
Carrier: Airtel
Posts: 75
Default

Implement a PlayerListener to monitor the media events, it will help you in understanding the exact issue.

--Pulkit
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


1PC USED A54MA55B BC186A413G52 Mitsubishi A500/F540 Series 55KW Drive Board #CZ picture

1PC USED A54MA55B BC186A413G52 Mitsubishi A500/F540 Series 55KW Drive Board #CZ

$317.00



Radiomatic Flo-One Beta Radio-Chromatography Detector A-500 Model A525 [E2FL] picture

Radiomatic Flo-One Beta Radio-Chromatography Detector A-500 Model A525 [E2FL]

$245.00



Mitsubishi FR-A540-0.75K-NA AC DRIVE INVERTER 1 HP 380-480 VAC 50/60 HZ 4.1 AMP  picture

Mitsubishi FR-A540-0.75K-NA AC DRIVE INVERTER 1 HP 380-480 VAC 50/60 HZ 4.1 AMP

$649.99



A54MA55B and BC186A413G52 frequency converters A500/F540 series 55KW drive board picture

A54MA55B and BC186A413G52 frequency converters A500/F540 series 55KW drive board

$350.00



1PC USED A54MA30B Mitsubishi F500/A500/A540 Series 30-37KW Drive Main Board #CZ picture

1PC USED A54MA30B Mitsubishi F500/A500/A540 Series 30-37KW Drive Main Board #CZ

$255.00



Mitsubishi A500 Variable Freq. Drive VFD AC Inverter 480V 3 PH 6.7A 3 HP Max picture

Mitsubishi A500 Variable Freq. Drive VFD AC Inverter 480V 3 PH 6.7A 3 HP Max

$299.99







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.