Search code examples
objective-ccocos2d-iphoneavaudioplayerccsprite

Animating Cartoon Sprite using CDAudioManager in Cocos2D


In my application I have a cartoon animation, with two characters that speak with each other. I need to animate their mouth, to give the impression of synchronism between the speech and the opening/closing of their mouth.

I know that CDAudioManager is a wrapper around AVAudioPlayer, so I have the isMeteringEnabledproperty available.

Is there a way to use the meter levels do upadte the two frames of the characters' mouth (open and close)? Or is there a better approach for this? Thanks!


Solution

  • I don't think you can work around it smoothly... As to get the meter levels at a particular time you have to check it at particular interval using a timer... So if you find the sound level high.. Open the mouth for that period of time.. Its uncertain...

    What I did was played a constant animation during whole speaking process...

    Check for my app here

    I provided this link as its a free app.. If you have jail broken iPhone check for this app

    In all the characters same thing is implemented.. :)