Question by
Sharpless512 · Apr 16, 2016 at 10:33 AM ·
assetbundleaudiosourceaudioclip
GetData from AudioSource after AudioLowPassFilter
Currently I move a box depending on the audio data
private AudioSource audioSource;
public GameObject box;
public AudioLowPassFilter audioLpf;
float[] samples;
void Start () {
audioSource = gameObject.GetComponent<AudioSource>();
samples = new float[audioSource.clip.samples * audioSource.clip.channels];
audioSource.clip.GetData(samples, 0);
}
void Update () {
float currentSample = samples[audioSource.timeSamples];
box.transform.localScale = new Vector3(1, currentSample*100, 1);
}
But the box transform works on the original Audiosource and not the version where the audioLowPassFilter is on.
How do I get the data from the audioLowPassFilter?
Comment
Your answer
Follow this Question
Related Questions
Error FMOD::Sound instance - no sound is being played from AssetBundle 0 Answers
How can i select music from mobile that will play in unity audiosource? 0 Answers
Does an audio source with zero volume take an audio channel? 0 Answers
Is there a way to update the audioclip of an object pooled audiosource instance? 1 Answer
I want the audio to play when the player nears the object, but fade away when they walk away. 0 Answers