Unfortunately, I haven’t been able to reproduce the issue you’re describing.
No, you shouldn’t need to do anything extra. If you take a look at the “net_stream” Core API example included with the FMOD Engine installer, Channel::setMute is used to mute and unmute the net stream in when buffer starvation occurs.
A few questions:
What version of the FMOD Engine are you using?
Are you able to reproduce the same issue in the previously mentioned “net_stream” example?
How specifically are you creating the streaming sound? i.e. what modes are you using, and what settings are used for FMOD_CREATESOUNDEXINFO if any?
I see I didn’t mention I’m using this from Unity, so I using the FMOD for Unity, not the “bare” Engine.
I can see that when I attempt to unmute the stream, it is VIRTUAL.
for the modes I was struggling a bit at first, but I now have this working
FMOD.RESULT result = system.createSound(streamUrl,
MODE.CREATESTREAM | MODE.NONBLOCKING | MODE.LOOP_NORMAL,
out sound);
After actually looking at the MODES (and not just using AI’s proposed and apparently half working stuff) I removed the NONBLOCKING and LOOP_NORMAL which don’t make any sense on a radio-stream.
But now the stream feels/sounds like it’s getting paused, meaning that when I Unmute, it resumes where it was muted, not “realtime”, meaning the stream is getting behind “live” sound.
That’s definitely strange. If you use ChannelControl::setVolume to set the volume to 0 or slightly above it (i.e. 0.05) instead of muting, does the same behavior occur? I’d also recommend using Channel::setPriority to see the priority to 0, just in case this is some kind of interaction between the stream and virtualization system.
Could I also get you to set your Logging Level to “Log”, enable API error logging, and send a log in which you reproduce the issue?
With setMute(true/false) or setVolume(0f/1f) and channel::priority=default=128 this result:
Channel before setMute(true): isPlaying=True, getPaused=False, isVirtual=False
Channel after setMute(true): isPlaying=True, getPaused=False, isVirtual=False
Channel becomes virtual quite quick after this, within 100 ms.
Channel before setMute(false): isPlaying=True, getPaused=False, isVirtual=True
Channel after setMute(false): isPlaying=True, getPaused=False, isVirtual=True
After setting the priority of the channel to 0, it will not become virtual and this results in a continuing stream, not paused.
Setting the volume “low” obviously also continued the stream.