Say you play a sound multiple times resulting into multiple channel objects. What is the life-time of a channel object?
When it stops playing is the channel object deconstructed? Or does it stay alive until the sound itself is deconstructed?
If its stays alive, what will FMOD return if you try to change the volume?
- Anonymous asked 8 years ago
I would like to know the internal design of FMOD.
As a user you get a pointer to FMOD::Channel by calling FMOD::System::playSound(). I want to know if the pointer to channel is still valid (not deleted by fmod internally) when the sound has stopped playing. If it is deleted, this would mean that setting the channel volume after playing, the code will crash. So I think FMOD might be waiting for the deletion of channel objects until the FMOD::Sound is released/deleted to minimize user mistakes. FMOD::Channel::SetVolume would result into FMOD_ERR_INVALID_HANDLE.
- Anonymous answered 8 years ago
[quote:135iqzjz]this would mean that setting the channel volume after playing, the code will crash.[/quote:135iqzjz]
FMOD wont crash in this situation. It will return FMOD_ERR_INVALID_HANDLE. Your Channel* is a handle [i:135iqzjz]not [/i:135iqzjz]a pointer to an object which can be deleted.
Channels are managed internally you don’t need to delete them. You can delete FMOD::Sounds by using Sound->release()
- Guest answered 8 years ago
Please login first to submit.