Is there a way to set a channel as virtual? I only see how to set priorities that let FMOD turn a channel to virtual. But my musician wants to make multi-channel music where certain channels only play in certain locations of the game. Virtual channels seem perfect, as they continue moving the cursor location in the virtual sounds even when they are not playing. I could lower the non-playing sounds’ volumes to zero, but this seems VERY inefficient.
Perhaps this could be a new feature?
- Timmy BigHands asked 12 years ago
[quote="bjone":9fo9c6aa]Effectively, putting the Volume to 0 should make FMOD put the Channel in the Virutal pool. [/quote:9fo9c6aa]
This does NOT happen. I played a sound, set its volume to zero, waited a few ticks, and then called isVirtual() on its channel. That method returned false.
Right now, my musician is giving me multiple ogg files. He wants me to play all of them at once, but some of them are muted except in certain locations of the game. For example, I have 6 ogg files for a city’s theme music, but one of them just plays the violin contribution and is only heard in certain areas of the city.
I was planning to simply switch that violin channel to virtual when the player was not in that area, but I couldn’t find a method to do that. Now I am wondering if it’s possible, and if not, how else I can achieve this goal.
Can you recommend a good tool to create multichannel oggs? We’ve tried BeSweet, without much luck, and our other tools cannot output a multichannel ogg file.
While I am asking questions, would you have any idea why some mp3 files cannot be played by FMOD? I cannot play any mp3 created with Windows Media Player 10, but I can play ones created with SoundForge. WinAmp 5.1 can play both, so they are valid mp3 files. I have tried varying the bit rate, frequency, tags, header size, just about everything, and there seems no rhyme or reason to it. The call to createSound() returns FMOD_ERR_FORMAT for the unplayable mp3’s.
I agree that having a FMOD::Channel::ForceVirtual( bool ) would be a nice thing.
I understand that the “virtual” attribute is re-evaled each System::update, but having some kind of user_virtual could be usefull.
let me explain:
say you have a character in a game that starts a dialogue, triggered by a script.
from within the engine, you now that the 3D emitter is inaudible, but you want that the player catch the discussion in the middle (say you don’t -want- to delay the audio dialogue -until- the sound emitter is audible).
so what would be cool, is that you start a sound in a channel, put it explicitly virtual, fmod advance buffer pointer, and when the emitter is known to be audible by the engine, the user_virtual attribute is “removed” by the engine, and then fmod evaluates effective volume and its propension to be binded to a physical channel.
[quote="Adion":1q4ns93l]Why not just mute/set volume to zero when you know the sound will be inaudible?[/quote:1q4ns93l]
Efficiency. Virtual channels use very little (or no) CPU overhead. A sound playing with a volume of zero seems to use the same overhead of a sound playing at full volume.
Effectively, putting the Volume to 0 should make FMOD put the Channel in the Virutal pool. you’ve got point.
Timmy BigHands >> effectively, you seem to talk about the “Music” case. in this case this is somewhat different because i suppose that a Mod/S3M/5.1 streams are handled differently that classical 2D/3D channels (for sound effect).
Your context is different that the one i was talking about, so sorry for the digression 😀
[quote="bjone":1odepwy4]Effectively, putting the Volume to 0 should make FMOD put the Channel in the Virutal pool. you’ve got point.[/quote:1odepwy4]
I’m not sure, but I thought fmod already did this?
It would be quite easy to test I think, just play a lot of sounds at volume 0, and see if there’s a difference in cpu usage compared to a volume >0.
Please login first to submit.