// single ear public AudioClip getScaledSpeechClip(string clipName, float dB, Channel chan) { if (!scaledSpeechList.Exists(x => x.name == clipName && x.dB == dB && x.chan == chan)) { ScaledSoundClip sclip = new ScaledSoundClip(); sclip.clip = getSpeechClip(clipName).CreateScaledClip(dB, chan); sclip.name = clipName; sclip.dB = dB; sclip.chan = chan; scaledSpeechList.Add(sclip); return(sclip.clip); } else { return(scaledSpeechList.Find(x => x.name == clipName && x.dB == dB && x.chan == chan).clip); } }
// both ear public AudioClip getScaledSpeechClip(string clipName, float dBLeft, float dBRight) { if (!scaledSpeechList.Exists(x => x.name == clipName && x.dBLeft == dBLeft && x.dBRight == dBRight && x.chan == Channel.Both)) { ScaledSoundClip sclip = new ScaledSoundClip(); sclip.clip = getSpeechClip(clipName).CreateBilateralScaledClip(dBLeft, dBRight); sclip.name = clipName; sclip.dBLeft = dBLeft; sclip.dBRight = dBRight; sclip.chan = Channel.Both; scaledSpeechList.Add(sclip); return(sclip.clip); } else { return(scaledSpeechList.Find(x => x.name == clipName && x.dBLeft == dBLeft && x.dBRight == dBRight && x.chan == Channel.Both).clip); } }