예제 #1
0
 // 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);
     }
 }
예제 #2
0
 // 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);
     }
 }