Author Topic: NGUITools.PlaySound pitch bug  (Read 5876 times)

beermoney

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 80
    • View Profile
NGUITools.PlaySound pitch bug
« on: September 02, 2014, 11:45:59 AM »
Hi Aren, I noticed if I play a audioclip using the NGUITools.PlaySound(someClip, 1, 0.05) then play another audioclip with another pitch (say pitch = 1) before the first audio clip has finished then the pitch if the first audio clip changes to 1 instead of 0.05 (ie. doesn't play as I set it too).

Appologies for the short explanation!

Thanks

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUITools.PlaySound pitch bug
« Reply #1 on: September 02, 2014, 12:37:04 PM »
If you look inside NGUITools.PlaySound, you will see that it uses only one AudioSource, and plays sounds via PlayOneShot. Pitch is specified on the AudioSource, which is why changing it for one affects the others.

If you need different pitch, you need to use different audio sources.