What if I don't want audio listeners? ;-)

I’m currently developing my standalone server and have switched the main camera off because graphics don’t work at all on the machine I wish to deploy this to, and I’m trying to get as close as possible to a “headless server” (I’ll ask more about that later :wink: ).

However, when I switch off my main camera, I’m getting a lot of “There are no audio listeners in the scene.” info messages. I find this somewhat annoying and not really useful for this particular usecase (even though I think it’s very nice to have this when you accidentally have no audio listener and wonder why you don’t hear sound).

Is it possible to turn this message off somehow? I’d like to avoid having to go through all my audio-sources and disable them to get that effect, but if that’s the only way, I might give that a try :wink:

Any more elegant solutions?

Jashan

put in an empty gameobject with an audio listener component? :stuck_out_tongue:

Actually I’d rather not have any sound at all on the server, as the server doesn’t have a sound card and I don’t want things to get confused…

Interestingly, this message didn’t pop at me again, even though I still don’t have an audio listener component. Well, that’s nice :wink:

Jashan

I get the “i’ve got 4 audio listeners in the scene” error all the time because I have multiple cameras that can be turned on. Can I turn all but one sound off?

Sure. This was something that changed with 2.0. With 1.x you had to add your own audio listeners but in 2.0 it’s done automatically.

ok, lets keep things clear… audio listeners don’t create sound, so there is no harm in having them in a headless server, so long as there are no audio sources to make sound. There is no real overhead issues here, so leave it in.

In regards to DaveyJJ having 4 audio listeners… thats now a bad thing in Unity 2.0.
We used to have an audio listener on each camera in StuntMANIA, but have now moved the audio listener to a gameObject that sits on the car, so now we only need the one.

The audio listeners themselves don’t create sound, that’s true - but the “stuff in the scene” does. By removing the camera and audio listeners, I make sure this is not a potential source of whatever troubles there might be.

I guess it’s just a matter of “keeping the house clean” and not doing things that are completely useless on a server sitting lonely in some rack at some hoster that’s just there for doing some calculations and passing on RPCs :wink:

Of course, consequently, I might consider switching off all the audio sources. But while switching off the camera is trivial, switching off all the sound sources for the server build would be effort, and I don’t like effort :wink:

You should really be tracking if the player is a server or not and turn off ALL un-needed stuff in the server… any sounds, scripts, movies etc… Yes its a bit of effort now, but will make your life easier later.

You’re definitely right… I’m just realizing that even though I’ve turned all cameras off (and therefore, obviously also all audio listeners), the sound is still playing. I guess that’s what you originally meant :wink:

Well, guess I’m heading for another iteration of major cleanup :slight_smile: