VAUAudioRendererGenericPath.cs 1001 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class VAUAudioRendererGenericPath : VAUAudioRenderer
{

	[Tooltip("Generic path renderer channel number")]
	public int NumberOfChannels = 2;

	[Tooltip("Generic path renderer channel number")]
	public int FilterLengthSamples = 88200;

	[Tooltip("Generic path renderer sampling rate")]
	public double SamplingRate = 44100;

	[Tooltip("Generic path renderer default impules response file")]
	public string IRFilePath = "";

	[Tooltip("Generic path sound source")]
	public VAUSoundSource SoundSource;

	[Tooltip("Generic path sound receiver")]
	public VAUSoundReceiver SoundReceiver;

26 27
	private bool UpdatePerformed = false;

28 29 30 31 32 33
    void Start ()
	{
    }
	
	void Update()
	{
34 35 36 37 38
		if (SoundSource && SoundReceiver && !UpdatePerformed) {
			VAUAdapter.VA.UpdateGenericPathFromFile (ID, SoundSource.ID, SoundReceiver.ID, IRFilePath);
			if( SoundSource.ID > 0 && SoundReceiver.ID > 0 )
				UpdatePerformed = true;
		}
39 40
	}
}