-
Just to be sure... when I have a sound with lets say a noise datasource and I don't need this sound anymore, am I right, that I should first uninit the sound and then the noise? When I would like to reuse the datasource struct (like noise), is it safe to uninit the sound where it was used and initialise another sound with the noise struct? Am I right, that the datasource should be used only with one sound? Maybe there should be the unit calls used in this example: https://github.com/mackron/miniaudio/blob/master/examples/simple_playback_sine.c |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You are correct - you need to uninitialize the sound before the data source. The reason is that the two are decoupled, and since the sound is pulling from the data source, you would be pulling the data source from under the sound if you were to uninitialize it first.
This should be safe, yes.
Yes, you should only have a singe sound referencing a data source at any given time. The missing waveform uninit in that example is an oversight. I'll need to address that. Thanks for bringing that to my attention. |
Beta Was this translation helpful? Give feedback.
You are correct - you need to uninitialize the sound before the data source. The reason is that the two are decoupled, and since the sound is pulling from the data source, you would be pulling the data source from under the sound if you were to uninitialize it first.
This should be safe, yes.
Yes, you should only have a singe sound referencing a data source at any given time.
The missing waveform uninit in that example is an oversight. I'll need to address …