- Home /
Using stereo sound
I'm wanting to have an object that emits a sound, but so that it gets louder the closer you get to it, and that when the character moves, the sound changes depending on the direction you're facing. so when it's on their left, the sound will be louder out of the left headphone. I've made an object and attached an audio source to it, and made my character an audio listener. but that's as far as I've got. Been trying to mess around with the settings, but no luck so far. Help would be really appreciated.
Answer by Julien-Lynge · Jan 10, 2013 at 07:00 PM
You need to go to the import settings for your audio clip, and make sure the box for 3D sound is checked. Then, simple place the audio source in scene where the sound should be coming from, and Unity will take care of all the directionality and volume. You can tweak the parameters in the Audiosource; for instance, the falloff determines how quickly the volume drops as you move away from the source.
That's what I thought, but for some reason nothing happens. I have checked the box that says it's 3D, and messed around with the settings, but still nothing. I can hear the sound the same no matter where my player is. Would there be any reason why it wouldn't be working?
What are the settings for $$anonymous$$ and max distance? It's possible that you simply aren't moving the character far enough to hear a change in volume. Try taking down the max distance a bit.
When you turn the character, do you hear the sound in the correct ear? What are your settings for pan and spread? You may want to just include a screenshot.
I've got my settings really low. I can see on the graph that it should be getting quieter, but no matter where I am, it's the same volume. And the sound is co$$anonymous$$g out of both headphones like it's not 3D even though it is. I would attach a screenshot, but for some reason my computer won't let me
I've just got it to stop playing the music depending on how far away I am. I put the 'pan' and 'spread' settings right up. But it's still not making a difference to the direction of the object.
Ideally, Pan level should be 1 and spread should be 0. If you take spread up, you'll have sound bleed into the other ear. When you look at the clip in the audiosource, does it say that it's a 3D sound or a 2D sound? How are you playing the sound?
Your answer
Follow this Question
Related Questions
How do i add/import sound effects and/or music into my game? 5 Answers
Why Doesn't My Music Loop? 5 Answers
How to keep music playing when android screen is turned off (or locked)? 0 Answers
iOS music player & youtube mutes sound in app 0 Answers
How to have audio only be heard in a certain radius? 4 Answers