0
0

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?

  • Marin
  • You must to post comments
0
0

I think that as soon as you stop the channel or release the sound it contains, the channel is released and usable again by FMOD. I don’t know if this is what you mean by "deconstructed".

  • You must to post comments
0
0

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.

  • You must to post comments
0
0

[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()

-Pete

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.