# Slow motion effect for sound

**URL:** <https://qa.fmod.com/t/slow-motion-effect-for-sound/12585>\
**Category:** FMOD Engine\
**Created:** [July 12, 2016, 10:38am UTC](https://qa.fmod.com/t/slow-motion-effect-for-sound/12585 "2016-07-12T10:38:50Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![klymenko.volodymyr.m](https://avatars.discourse-cdn.com/v4/letter/k/82dd89/32.png) [@klymenko.volodymyr.m](https://qa.fmod.com/u/klymenko.volodymyr.m)\
**Post date:** [July 12, 2016, 10:38am UTC](https://qa.fmod.com/t/slow-motion-effect-for-sound/12585/1 "2016-07-12T10:38:50Z")

</div>

Hello,

I’m very new to FMOD. Actually I’ve interested in it because I need to implement one simple(as I think) thing - it’s slowing down music and sounds when pause menu occurs and accelerate up after it hides.

Something like here - [https://vimeo.com/174327353](https://vimeo.com/174327353)

Is there a simple way achieve this? I tried just to set using default **cocos2d-spritebuilder** engine pitch linearly, but it work very bad…

How this effect can be done with FMOD? Can someone please provide some code example? Thank you in advance.

p.s.: is there any wrapper for Objective C? Just for using simple features like play, stop, pitch and other ?

---

<div class="post-metadata">

**Author:** ![adriansantos](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@adriansantos](https://qa.fmod.com/u/adriansantos)\
**Post date:** [July 12, 2016, 4:00pm UTC](https://qa.fmod.com/t/slow-motion-effect-for-sound/12585/2 "2016-07-12T16:00:04Z")

</div>

Hi Volodymyr,

I would solve this with a simple parameter in the event editor, with a smoothing seek speed, or using a RPM parameter.  
When you send the information to stopped your sound, you design de sound with change in pitch, or change the modulation ADSR in your pitch, or use a snapshot to change all sounds around.  
You have many ways to do this.  
Good luck!

---

<div class="post-metadata">

**Author:** ![klymenko.volodymyr.m](https://avatars.discourse-cdn.com/v4/letter/k/82dd89/32.png) [@klymenko.volodymyr.m](https://qa.fmod.com/u/klymenko.volodymyr.m)\
**Post date:** [July 12, 2016, 4:06pm UTC](https://qa.fmod.com/t/slow-motion-effect-for-sound/12585/3 "2016-07-12T16:06:41Z")

</div>

> [@](#):
>
> Hi Volodymyr,
> 
> I would solve this with a simple parameter in the event editor, with a smoothing seek speed, or using a RPM parameter.  
> When you send the information to stopped your sound, you design de sound with change in pitch, or change the modulation ADSR in your pitch, or use a snapshot to change all sounds around.  
> You have many ways to do this.  
> Good luck!

Thank for the answer, however all looks very unclear for me…  
Can you please provide some code example? I’m familiar with C++ a little bit, because I developing my game with Box2D. However, while now I’m trying to understand something from FMOD examples… it’s really complicated. I’m looking for lets say light solution.  
Ideally, I’m looking for demo project with cocos2d-spritebuilder and playing any slowing down sound as you said. Because now from I can’t easily integrate it to my game or even play some sound… it’s like said on cocos2d forums - “engine for big boys” and yes, developers of Badland they are, but not me. I would really appreciate any help anyway, because I really need this cool effect into my game.

---

<div class="post-metadata">

**Author:** ![mathew](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mathew/32/431_2.png) [@mathew](https://qa.fmod.com/u/mathew)\
**Post date:** [July 12, 2016, 10:59pm UTC](https://qa.fmod.com/t/slow-motion-effect-for-sound/12585/4 "2016-07-12T22:59:50Z")

</div>

You can achieve this programmatically by getting the master channel group if you are using the low level API (System::getMasterChannelGroup).

With the master channel group call ChannelGroup::setPitch to lower the pitch of everything at the same time. You will want to call this several times over a certain duration to get a nice ramp down.

Objective-C and Objective-C++ are backwards compatible with C and C++ respectively, you can use our C API with .m files, if you want to use our C++ API rename your source file to .mm and use it directly.

---

<div class="post-metadata">

**Author:** ![klymenko.volodymyr.m](https://avatars.discourse-cdn.com/v4/letter/k/82dd89/32.png) [@klymenko.volodymyr.m](https://qa.fmod.com/u/klymenko.volodymyr.m)\
**Post date:** [July 13, 2016, 9:15am UTC](https://qa.fmod.com/t/slow-motion-effect-for-sound/12585/5 "2016-07-13T09:15:17Z")

</div>

> [@](#):
>
> You can achieve this programmatically by getting the master channel group if you are using the low level API (System::getMasterChannelGroup).
> 
> With the master channel group call ChannelGroup::setPitch to lower the pitch of everything at the same time. You will want to call this several times over a certain duration to get a nice ramp down.
> 
> Objective-C and Objective-C++ are backwards compatible with C and C++ respectively, you can use our C API with .m files, if you want to use our C++ API rename your source file to .mm and use it directly.

Can you please give some Objective-C++ code example? Even for just some UIKit app would be great! Thanks.

---

<div class="post-metadata">

**Author:** ![mathew](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mathew/32/431_2.png) [@mathew](https://qa.fmod.com/u/mathew)\
**Post date:** [July 14, 2016, 10:12pm UTC](https://qa.fmod.com/t/slow-motion-effect-for-sound/12585/6 "2016-07-14T22:12:47Z")

</div>

I’m not in a position to provide code level support services, however the APIs are very straight forward and you can read about them online:

[http://www.fmod.org/documentation/#content/generated/FMOD\_System\_GetMasterChannelGroup.html](http://www.fmod.org/documentation/#content/generated/FMOD_System_GetMasterChannelGroup.html)  
[http://www.fmod.org/documentation/#content/generated/FMOD\_ChannelGroup\_SetPitch.html](http://www.fmod.org/documentation/#content/generated/FMOD_ChannelGroup_SetPitch.html)

---

<div class="post-metadata">

**Author:** ![klymenko.volodymyr.m](https://avatars.discourse-cdn.com/v4/letter/k/82dd89/32.png) [@klymenko.volodymyr.m](https://qa.fmod.com/u/klymenko.volodymyr.m)\
**Post date:** [July 20, 2016, 2:43pm UTC](https://qa.fmod.com/t/slow-motion-effect-for-sound/12585/7 "2016-07-20T14:43:56Z")

</div>

I’ve opened play\_sound example and added code:

system-\>getMasterChannelGroup(channelgroup);  
FMOD\_ChannelGroup\_SetPitch(channelgroup, 0.1);

However, it’s not compiling and I got an error:  
No matching function for call to ‘FMOD\_ChannelGroup\_SetPitch’

Is any example of play and pitch sounds?

---

<div class="post-metadata">

**Author:** ![mathew](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mathew/32/431_2.png) [@mathew](https://qa.fmod.com/u/mathew)\
**Post date:** [July 20, 2016, 10:41pm UTC](https://qa.fmod.com/t/slow-motion-effect-for-sound/12585/8 "2016-07-20T22:41:37Z")

</div>

You can see an example of ChannelGroup::setPitch in the “channel\_group” example.

---

<div class="post-metadata">

**Author:** ![klymenko.volodymyr.m](https://avatars.discourse-cdn.com/v4/letter/k/82dd89/32.png) [@klymenko.volodymyr.m](https://qa.fmod.com/u/klymenko.volodymyr.m)\
**Post date:** [July 21, 2016, 4:22pm UTC](https://qa.fmod.com/t/slow-motion-effect-for-sound/12585/9 "2016-07-21T16:22:59Z")

</div>

Okay, I figure out. Thanks. This C isn’t so simple… Is any Objective C wrapper for your engine?

---

<div class="post-metadata">

**Author:** ![mathew](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mathew/32/431_2.png) [@mathew](https://qa.fmod.com/u/mathew)\
**Post date:** [July 21, 2016, 10:24pm UTC](https://qa.fmod.com/t/slow-motion-effect-for-sound/12585/10 "2016-07-21T22:24:20Z")

</div>

As I mentioned in the above answer, there is no Objective-C wrapper as the language is backwards compatible with C and C++. If you are finding C too different, use C++, just make sure your source files are .mm not .m or you will get compile errors.
