# Time stretch sound quality in unity

**URL:** <https://qa.fmod.com/t/time-stretch-sound-quality-in-unity/18656>\
**Category:** Unity\
**Created:** [April 14, 2022, 9:59am UTC](https://qa.fmod.com/t/time-stretch-sound-quality-in-unity/18656 "2022-04-14T09:59:56Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![cx5289](https://avatars.discourse-cdn.com/v4/letter/c/ce7236/32.png) [@cx5289](https://qa.fmod.com/u/cx5289)\
**Post date:** [April 14, 2022, 9:59am UTC](https://qa.fmod.com/t/time-stretch-sound-quality-in-unity/18656/1 "2022-04-14T09:59:56Z")

</div>

Use pitch shifter pugin and master pitch to achieve time stetch effect,like:[Time stretch hack for FMOD - YouTube](https://www.youtube.com/watch?v=qxhHWBQdCbU)

I set 3 lable of speeds, 1x, 2x, 3x

When accelerating, the sound quality of the sound will deteriorate when the playback is accelerated in Unity, and the diffusion of the sound image will diverge, like a spread effect .but this is not a must every time. [FMOD Time Stretch in unity - YouTube](https://www.youtube.com/watch?v=o8k6Fc8izSE)

---

<div class="post-metadata">

**Author:** ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)\
**Post date:** [April 19, 2022, 2:59am UTC](https://qa.fmod.com/t/time-stretch-sound-quality-in-unity/18656/2 "2022-04-19T02:59:48Z")

</div>

A lot of this can be down to the sample rate of the audio file you’re using.

A higher sample rate on an audio file allows you to change pitch with fewer artefacts at the cost of requiring more resources. Ensure your raw audio file is rendered at a high sample rate and match that setting the in the asset browser’s Advance Encoding Settings before building to a bank.

---

<div class="post-metadata">

**Author:** ![cx5289](https://avatars.discourse-cdn.com/v4/letter/c/ce7236/32.png) [@cx5289](https://qa.fmod.com/u/cx5289)\
**Post date:** [June 23, 2022, 2:55am UTC](https://qa.fmod.com/t/time-stretch-sound-quality-in-unity/18656/3 "2022-06-23T02:55:54Z")

</div>

It s not worked,highest sample rate is 48khz

---

<div class="post-metadata">

**Author:** ![joseph](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/joseph/32/264_2.png) [@joseph](https://qa.fmod.com/u/joseph)\
**Post date:** [June 24, 2022, 5:20am UTC](https://qa.fmod.com/t/time-stretch-sound-quality-in-unity/18656/4 "2022-06-24T05:20:48Z")

</div>

Is that the sample rate of both the source audio file and the asset in FMOD Studio’s assets browser?

---

<div class="post-metadata">

**Author:** ![cx5289](https://avatars.discourse-cdn.com/v4/letter/c/ce7236/32.png) [@cx5289](https://qa.fmod.com/u/cx5289)\
**Post date:** [June 24, 2022, 9:45am UTC](https://qa.fmod.com/t/time-stretch-sound-quality-in-unity/18656/5 "2022-06-24T09:45:56Z")

</div>

yes,the same sample rate 48khz i used，the effect its ok in Fmod editor,but not in unity editor play

---

<div class="post-metadata">

**Author:** ![joseph](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/joseph/32/264_2.png) [@joseph](https://qa.fmod.com/u/joseph)\
**Post date:** [June 27, 2022, 2:31am UTC](https://qa.fmod.com/t/time-stretch-sound-quality-in-unity/18656/6 "2022-06-27T02:31:43Z")

</div>

Have you tried adjusting the FFT size? Higher sizes are more computationally expensive, but achieve better quality results.

---

<div class="post-metadata">

**Author:** ![cx5289](https://avatars.discourse-cdn.com/v4/letter/c/ce7236/32.png) [@cx5289](https://qa.fmod.com/u/cx5289)\
**Post date:** [July 5, 2022, 6:21am UTC](https://qa.fmod.com/t/time-stretch-sound-quality-in-unity/18656/7 "2022-07-05T06:21:24Z")

</div>

FFT size is the same result,I remove the pitch shifter,keep pitch in master channel.The spread effect will no longer appear，but it will be changed the pitch

---

<div class="post-metadata">

**Author:** ![joseph](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/joseph/32/264_2.png) [@joseph](https://qa.fmod.com/u/joseph)\
**Post date:** [July 6, 2022, 2:34am UTC](https://qa.fmod.com/t/time-stretch-sound-quality-in-unity/18656/8 "2022-07-06T02:34:38Z")

</div>

> [@cx5289](#):
>
> I remove the pitch shifter,keep pitch in master channel.The spread effect will no longer appear，but it will be changed the pitch

I’m glad to hear you were able to achieve the behavior you wanted.
