Can't get setMute(false) to resume audio

I’m building an internet radio with streaming from an url.

While channel.setMute(true) nicely stops the audio, setMute(false) doesn’t resume the audio.

(I don’t want to pause the stream so it will lag behind and/or stop)

I tried this on the channel, on channel.getChannelGroup, on masterchannelgroup, but no audio on “unMute”.

Do I need to do/restart something extra after this call?

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?
  • Is the channel still playing, not paused, and not virtual when and after you attempt to unmute it?
  • What result does Channel::setMute return when you attempt to unmute the channel?

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.

And now the setMute(false) works.

Sorry, my bad, lazy weekends :wink:

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.

Even though getPaused() returns false.

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.