You Are Here:

Community: Developer Discussion Boards

#1 Old Overflow when playing sound - 2003-03-31, 13:29

Join Date: Mar 2003
Posts: 19
abickerton
Offline
Registered User
Hi,

I'm having a problem with the Series 40 phones, 7210 & 5100 so far.

The following code prdouces a global root overflow, I have tried this code outside of a thread to further narrow it down.
public void playSound(int freq, int dur, int volume){
new Thread(){
public void run(){
Sound snd = new Sound(freq, dur);
if(volume != 0)
snd.setGain(volume);
snd.play(1);

}
}.start();
}

Can anyone suggest a work around or a better way of doing it.

It's in a thread to avoid the game pausing while the sound is being played
Reply With Quote

#2 Old 2003-03-31, 15:22

Join Date: Mar 2003
Posts: 419
Location: Irving, Texas, USA
pbergius
Offline
Regular Contributor
Hello,

It is hard to determine exact cause for root overflow from the code snippet you provided. My educated guess is that you create too fast too many objects (Threads). Probably garbage collector can't remove unreferenced objects before object reference space is exhausted.

My only suggestion would be that you create a separate thread for game engine and let the sounds to be played as they are needed without creating a thread.

Regards,

Petteri / Forum Nokia
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

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

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d134434X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZentertainmentQ qfnZtopicQUqfnTopicZj2meQ qfnZtopicQUqfnTopicZjavaQ qfnZtopicQUqfnTopicZmediaQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ