Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Why only 299 sounds can be used?

Author
Message
Alex_Peres
AGK Master
15
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 25th Mar 2013 14:47
Why we can use only 299 sounds? It's strange because I want to use 800+ sounds at one time...
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 25th Mar 2013 15:12
Where did you come up with the number 299?

And I would think that an app would be very slow running 800+ sounds at one time (and not easy to listen to).

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 25th Mar 2013 15:16
Until recently, the limit would have probably been 32 - it might still be just 32, but AppGameKit probably does a lot of work behind the scenes allowing more sounds.

So the actual limit is probably 32 sounds at once being played, when there are more than that - well you have to swap sound buffers about - if you have 299 sounds, swapping sound buffers, eating up memory, then your app will be so slow that having 500 less sound effects will be the least of your worries

I got a fever, and the only prescription, is more memes.
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 25th Mar 2013 15:23
It's a platform limit for OAL - usually 16 or 32.

800???? The mind boggles. I think you mean a pool of 800. That's fine.

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL
Alex_Peres
AGK Master
15
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 25th Mar 2013 15:48 Edited at: 25th Mar 2013 15:49
I want to load all of game sounds at ones! I don't want to load|reload them every time. Of course I will use just 1-4 at one time, but to economy of time want to load all of them at begining!

Why AppGameKit allows me to load only 299 sounds???
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 25th Mar 2013 17:32
You can load all you want. Your initial post made it sound like you wanted to play them at the same time.

Again, where are you getting this 299 number from?

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
xCept
21
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 25th Mar 2013 17:44 Edited at: 25th Mar 2013 17:45
@AL, if you attempt to load a sound with an ID greater than 299, AppGameKit will throw an error: "Could not add sound file SOUND.wav - ID must be between 1 and 299"

Having said that, loading 300+ sounds all in one go (if it were possible) seems like it would use an incredible amount of memory and take a long time to complete even on a PC.
The Daddy
15
Years of Service
User Offline
Joined: 13th Jan 2009
Location: Essex
Posted: 25th Mar 2013 17:46
What system set up do you have....

It could easily be a memory issue, if you have low AVAILABLE ram, keeping in mind all your graphics stuff and code are <live> in ram, it is amazing how quick you can eat it up!

You could use audacity to lower the sample rates to make them smaller in size, you could also do the same with graphics, often dropping from 32bit images down to 24bit is a good space saver, but you need to check transparency use for 24bit....

Also keep in mind what system you wish to release on. Each system has a finite amount of usable ram....the nexus 7 for example has 1GB of ram.....thats is not all yours for your app....the system uses some of that!!!

Just a thought!

Me

http://bitmanip.com

Where is the digital?
Alex_Peres
AGK Master
15
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 25th Mar 2013 17:55 Edited at: 25th Mar 2013 17:58
Thanks for the answers,

But I still can't understand why... Why 299, not 256 or 512?
And why it will take a very long time to complete? If that sounds are really-really short!?
I think developers must make deсisions by them self how many sounds to use. For example, to change #define MAX_SOUNDS_NUMBER 299(any other number)...
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 25th Mar 2013 19:12
This must be a restriction in the Player. I just happily loaded 500 sounds into a Pascal program. Not that I would normally do that!

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 25th Mar 2013 20:36
Perhaps you should think about not loading that many all at once, and load them on the fly. It really is quite quick.

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Hodgey
15
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 25th Mar 2013 21:07
At the top of the cSound.h file, there is this:



Changing them should be okay due to the way they're defined but I can't guarantee it.

Alex_Peres
AGK Master
15
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 25th Mar 2013 21:29
Thank you all!!!

I'll try your suggestion Hodgey!
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 26th Mar 2013 02:00
he probably wants 300+ dubstep tracks all playing at once....sounds like heaven
The Daddy
15
Years of Service
User Offline
Joined: 13th Jan 2009
Location: Essex
Posted: 26th Mar 2013 11:03
I can sense a new beat matching game coming!


As Hodgey states changing csound.h should allow you to load more sounds however watch your release devices ram.....

Jim, of course you could load 500 sounds in Object Pascal......it is Object Pascal.....or as AL mentioned on another post Tier3.....it is simply better! Also, i am still surprised that more people are not using it as i understand that ios Xcode compiles object pascal......hence write once deploy everywhere.....you can even use it directly on a raspberry PI.....

Where is the digital?
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 26th Mar 2013 12:32
It's hard to imagine a game using 500 sound files unless you want 60 variations of an elf sneezing! However, for a music sequencer you might want this many instrument samples, but you'd usually pre-fetch them just before they're needed. Personally, I wouldn't use AppGameKit to create anything but a toy sequencer.

OpenAL restricts simultaneous sounds playing to 32.

With luck, Erik will release an update for the latest AGK. We've been waiting patiently for a stable version. I've been also waiting with the project manager because I suspect templates may change quite a lot as the system gets updated, and we don't want the C++ chaos that we've observed!

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL

Login to post a reply

Server time is: 2024-11-24 09:52:22
Your offset time is: 2024-11-24 09:52:22