views:

127

answers:

1

I am working on a Labyrinth style app for iPhone using Chipmunk and openAL. I got everything working except the ball rolling sound. What I have tried is playing a small sound for each update in the ball's position so that the overall effect sounds like the ball is rolling. Based on advice on this forum I tired using velocity of the ball to adjust pitch of the sound. I have the following problems:

  1. I cant hear the sound at all when I am playing this sound in a chipmunk call back. I can hear it elsewhere.
  2. Even if I got this working somehow, the sound I should play has to be very very short as the ball doenst take too long to roll. THere has to be a alternate way.

Can anybody please help? I can even pay for a simple application that did this if the sound is also included.

Thanks, Jagan

A: 

I recommend cheating... record (or find somewhere) some longish looping sounds of the ball rolling at different speeds. Have one of them playing, based on the speed of the ball. As the ball's speed changes, you can cross-fade from one sample to another. My guess is that that will sound more realistic than just varying the pitch of a single sample.

Of course, it may be enough just to have one longish looping sample, and only vary the volume proportional to the ball's speed. I'll have to go track down my labyrinth game and check. :)

Jeremy Friesner
Can you please send me a code sample? I can tell you how much help that would be. I think it also matters where i am varying this volume.
Jagan
Thanks Jeremy for the reply. Varying the volume based on velocity works like a charm.
Jagan