# Html5 fmod optimisation (smartphones)

**URL:** https://qa.fmod.com/t/html5-fmod-optimisation-smartphones/13466
**Category:** FMOD Studio
**Created:** [September 25, 2017, 3:12pm UTC](https://qa.fmod.com/t/html5-fmod-optimisation-smartphones/13466 "2017-09-25T15:12:48Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Lucile\_C](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@Lucile\_C](https://qa.fmod.com/u/Lucile_C)
#### Post date: [September 25, 2017, 3:12pm UTC](https://qa.fmod.com/t/html5-fmod-optimisation-smartphones/13466/1 "2017-09-25T15:12:48Z")

</div>

Hi!

Back here again.  
So, it seems like what we are doing with our sound banks is really CPU heavy for smartphones. The sounds stutter quite a lot everytime we call a change of parameter value… We tried playing with the DSP Buffer Size (and we’re kind of happy with what we ended setting up as it is much better than the result we had before) but it is not enough to solve all the stuttering.  
Which are the other options we could try ?

---

<div class="post-metadata">

### Author: ![brett](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/brett/32/261_2.png) [@brett](https://qa.fmod.com/u/brett)
#### Post date: [September 25, 2017, 10:09pm UTC](https://qa.fmod.com/t/html5-fmod-optimisation-smartphones/13466/2 "2017-09-25T22:09:56Z")

</div>

Hi, It sounds a bit more like the bank encoding settings. What format are you using? I would only recommend PCM or FADPCM on html5 on mobile.

Also lower your voice count with System::setSoftwareChannels, so that less mixing is happening, and they go ‘virtual’ when playing lots of sounds (by order of audibility/importance).

---

<div class="post-metadata">

### Author: ![Lucile\_C](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@Lucile\_C](https://qa.fmod.com/u/Lucile_C)
#### Post date: [September 26, 2017, 9:27am UTC](https://qa.fmod.com/t/html5-fmod-optimisation-smartphones/13466/3 "2017-09-26T09:27:44Z")

</div>

> [@](#):
>
> Hi, It sounds a bit more like the bank encoding settings. What format are you using? I would only recommend PCM or FADPCM on html5 on mobile.
> 
> Also lower your voice count with System::setSoftwareChannels, so that less mixing is happening, and they go ‘virtual’ when playing lots of sounds (by order of audibility/importance).

Hello,

Thanks for your answer.  
We were using fdapcm already. I will try setting the channel count and we will try using pcm instead to see if it can make things better.

---

<div class="post-metadata">

### Author: ![Lucile\_C](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@Lucile\_C](https://qa.fmod.com/u/Lucile_C)
#### Post date: [September 27, 2017, 11:13am UTC](https://qa.fmod.com/t/html5-fmod-optimisation-smartphones/13466/4 "2017-09-27T11:13:21Z")

</div>

Hi !  
So we tried using pcm, lowering channels count even to really low values without much better result… Any other option we can try ?

---

<div class="post-metadata">

### Author: ![brett](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/brett/32/261_2.png) [@brett](https://qa.fmod.com/u/brett)
#### Post date: [September 27, 2017, 1:00pm UTC](https://qa.fmod.com/t/html5-fmod-optimisation-smartphones/13466/5 "2017-09-27T13:00:40Z")

</div>

What is a lower value for you? If you had 2 to 8 voices active, i’d be surprised it used any significant cpu usage. Have you used System::getCPUUsage / FMOD\_System\_GetCPUUsage yet? What is the output rate and speaker mode? It should be stereo (FMOD\_SPEAKERMODE\_STEREO) and 24-44khz to save cpu time.

---

<div class="post-metadata">

### Author: ![brett](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/brett/32/261_2.png) [@brett](https://qa.fmod.com/u/brett)
#### Post date: [September 27, 2017, 1:00pm UTC](https://qa.fmod.com/t/html5-fmod-optimisation-smartphones/13466/6 "2017-09-27T13:00:44Z")

</div>

What is a lower value for you? If you had 2 to 8 voices active, i’d be surprised it used any significant cpu usage. Have you used System::getCPUUsage / FMOD\_System\_GetCPUUsage yet? What is the output rate and speaker mode? It should be stereo (FMOD\_SPEAKERMODE\_STEREO) and 24-44khz to save cpu time.

---

<div class="post-metadata">

### Author: ![Lucile\_C](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@Lucile\_C](https://qa.fmod.com/u/Lucile_C)
#### Post date: [September 28, 2017, 4:02pm UTC](https://qa.fmod.com/t/html5-fmod-optimisation-smartphones/13466/7 "2017-09-28T16:02:47Z")

</div>

Hi !  
I haven’t used the getCPUUsage function, but i can sure give it a go.  
When I said really low values I meant 4. I can try to set it to 2 and see what happens.

Thanks for your help 🙂

---

<div class="post-metadata">

### Author: ![brett](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/brett/32/261_2.png) [@brett](https://qa.fmod.com/u/brett)
#### Post date: [September 28, 2017, 11:27pm UTC](https://qa.fmod.com/t/html5-fmod-optimisation-smartphones/13466/8 "2017-09-28T23:27:09Z")

</div>

2 or 4 is not really any different, and I was not saying to hard limit fmod to that many voices, i was just reflecting on how many voices were actually playing at the time, if it was 2 to 8 it would be not noticable, unless you were using vorbis encoding maybe. You would not down force the number of voices to 2 unless you had a very limited audio environment. Checking getCPUUsage and getChannelPlaying is a good start to see if you’ve accidentally spawned too many voices.
