- Home /
Movie texture audio: no falloff
I have imported a video into Unity and am playing it on a plane. I have also attached the audio from the video to a game object in the world and assigned a maxDist of 10. However, when I move the AudioListener >10 away from the source, the sound doesn't fade out. No matter how far I go, the audio remains at the same level. I have many other audio sources in the scene that behave as expected.
Oddly, if I am using the editor and I pause after playing, the audio seems to fix itself. I've tried both mp4s and movs but I can't seem to falloff to work without pausing after play.
What am I missing?
what do you mean by 'the audio seems to fix itself' when you are in the editor?
sounds odd. you sure you're working with a 3d sound ins$$anonymous$$d of a 2d sound?
Here is what happens in the editor:
I hit play.
The audio from my movie begins to play, but it is at full volume. No matter where I move, the audio is at full volume. No rolloff whatsoever
I hit pause.
I unpause
The audio now has the expected rolloff. That is, when I am > 10, I hear no audio, but when I approach it, it gets louder.
I have many other audio sources in the scene that behave as expected in terms of rolloff, and the audio from my movie is set up identically, so it is definitely configured to be 3d. Even if it wasn't 3d, why would pausing and unpausing the game suddenly make it 3D?
I'm having the same bug, very annoying. It may be related to the old bug described here:
http://answers.unity3d.com/questions/11334/intermittent-movietexture-audio-track-problem.html
Answer by kyrnal · Aug 15, 2013 at 12:23 AM
I have ran into the same problem. After trial and error, I found a solution by using a specific combination of codecs. I output both of the files from After Effects.
The video is a Quicktime (.mov) Photo JPEG compression.
The audio is a separate uncompressed .wav.
Apply the audio to an Audio Source as usual, and apply the Movie Texture via a script. The audio syncs, behaves as 3D audio, and the video doesn't flash at the end.
using UnityEngine;
using System.Collections;
public class playMovie : MonoBehaviour {
public MovieTexture movTexture;
void Start () {
renderer.material.mainTexture = movTexture;
}
void Update () {
if (!movTexture.isPlaying){
movTexture.Play ();
movTexture.loop = true;
audio.Play ();
audio.loop = true;
}
}
}
Thank you for the code! I found as well that the only way to get it to work properly was to divorce my audio from my video, but syncing was an issue!
Answer by Rob Mills Audio · Jun 09, 2013 at 01:57 AM
select the gameobject that has the audio attached.
In 3D sound settings, there is a volume rolloff graph that depicts the volume curve as you approach or move away from the gameobject. If you move away from the object, you will see the red volume line moving down the curve (or line if linear) to the bottom right. But if this line doesn't reach the very bottom of the graph (volume = 0), then the sound will never be actually muted when exceeding max distance. Check these values.
One quick way to check is to select a linear rolloff method and listen.
Hey Rob -- thanks so much for your replies. And yes -- I did change the rolloff graph so that it goes down to 0 at distance 10. I only want these audio sources to be audible within a very small radius. I start with logarithmic rolloff, but then drag the last handle down to 0.
I am also aware of the red line that depicts the AudioListener, and I have watched it as it moves back and forth on the graph, but it is not accurate.
But as I said above, when it comes to the audio from movies, there is no discernible rolloff whatsoever, no matter how far away I go.
That is very strange indeed. Is there a way you can split the audio file from the video in case there is a formatting issue? Or does the audio and video have to be synced up in such a way that this cannot work? I'm stumped. sorry
Answer by hoperin · Mar 15, 2014 at 06:35 PM
I was running into the same problems and found, like Kyrnal, that using a seperate file rather than the video's audio was the only way to make it work. So I'm in the long process of batch converting all the mp4s into mp3s. This is really a pretty big bug (if bug it is), and a huge hassle. I couldn't find any other threads with a better solution than this one. ;c
Your answer
![](https://koobas.hobune.stream/wayback/20220613103723im_/https://answers.unity.com/themes/thub/images/avi.jpg)