Discussion:
[Audiere-users] Arrays of soundeffects
Zeuss (Caswal)
2005-03-01 19:41:12 UTC
Permalink
To make handling of a large amount of sound effects easier i was
writting a system that loads files, keeps track of they're names, and
runs a paralell array of soundeffects. This is a quick example of what
i have so far

...class definitions
//File Streams
SoundEffectPtr *sound_effects;
... other class definitions

Then to initialise the pointers i have on the constructer
sound_effects = new SoundEffectPtr[effect_count];

And then to load a sound effect:
sound_effects[cur_effect] = OpenSoundEffect(device, lsz_data, SINGLE );

Well, this crashes. And im completely new to Audiere.
Also what is the proper way to delete a soundeffect or does it do it
autmatically
Thanks.
--
hey hey, its Caz the wonderous person,
who tries his amusing quips and anecdotes
for you to enjoy.
Chad Austin
2005-03-03 11:13:36 UTC
Permalink
Hi Zeuss,

Seems odd that it would crash. What specific line causes the crash?

To answer your second question, when you delete[] the array of SoundEffectPtrs,
it should clean them up automatically. (That's why smart pointers are handy.)
Maybe you should try using a std::vector<SoundEffectPtr> instead of SoundEffectPtr*.

Any way you could make a reduced testcase?

Chad
Post by Zeuss (Caswal)
To make handling of a large amount of sound effects easier i was
writting a system that loads files, keeps track of they're names, and
runs a paralell array of soundeffects. This is a quick example of what
i have so far
...class definitions
//File Streams
SoundEffectPtr *sound_effects;
... other class definitions
Then to initialise the pointers i have on the constructer
sound_effects = new SoundEffectPtr[effect_count];
sound_effects[cur_effect] = OpenSoundEffect(device, lsz_data, SINGLE );
Well, this crashes. And im completely new to Audiere.
Also what is the proper way to delete a soundeffect or does it do it
autmatically
Thanks.
Loading...