- Home /
iPhone pitch not working?
Okay so here's my code in the update function
if (sound.isPlaying && stopping == true) { sound.pitch = sound.pitch-0.01; if (sound.pitch <= 0.1) { sound.Stop(); sound.pitch = 1; stopping = false; } }
A function is called which makes stopping = true. Then, for every frame, the pitch is reduced to 0.01. When the pitch is less than 0.1, it stops.
On the player inside Unity it works fine. In the iPhone however, the pitch does not change at all, but the music stops when it should. It's as if the pitch value is changing but not affecting the music.
Is this a limitation of compressed music on the iPhone?
Thanks
Answer by Eric5h5 · Feb 28, 2010 at 08:18 PM
Correct, compressed music played back through hardware does not have support for changing pitch. (As an aside, reducing pitch by .01 per frame makes your code framerate-dependent; you should use Time.deltaTime.)
Your answer
Follow this Question
Related Questions
App crashes due to FMOD error 0 Answers
Audio not coming out of speakers 1 Answer
wav "clicks" on audio.Stop() and audio.Play() on iPhone 1 Answer
Short sounds sometimes being missed 1 Answer
Oval audio source? 0 Answers