# Resample 48000 to 44100

**URL:** <https://qa.fmod.com/t/resample-48000-to-44100/16012>\
**Category:** FMOD Engine\
**Tags:** csharp, cpp\
**Created:** [July 26, 2020, 2:58pm UTC](https://qa.fmod.com/t/resample-48000-to-44100/16012 "2020-07-26T14:58:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![LoVic](https://avatars.discourse-cdn.com/v4/letter/l/77aa72/32.png) [@LoVic](https://qa.fmod.com/u/LoVic)\
**Post date:** [July 26, 2020, 2:58pm UTC](https://qa.fmod.com/t/resample-48000-to-44100/16012/1 "2020-07-26T14:58:57Z")

</div>

Hello!  
I receive blocks of data from the DSP PCM filter for further processing.  
Tell me what DSP filter I can use to convert the frequency from 48000 to 44100 in advance.  
The channel where the data is coming from is set to 44100kHz, but 48000 comes in to the DSP.

---

<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 28, 2020, 12:40am UTC](https://qa.fmod.com/t/resample-48000-to-44100/16012/2 "2020-07-28T00:40:37Z")

</div>

All sounds in FMOD (regardless of source sample rate) will be converted to the system sample rate on playback. You can control the system sample rate via System::setSoftwareFormat.

---

<div class="post-metadata">

**Author:** ![LoVic](https://avatars.discourse-cdn.com/v4/letter/l/77aa72/32.png) [@LoVic](https://qa.fmod.com/u/LoVic)\
**Post date:** [July 28, 2020, 9:00am UTC](https://qa.fmod.com/t/resample-48000-to-44100/16012/3 "2020-07-28T09:00:07Z")

</div>

Thank. But after initializing FMOD and calling system.setSoftwareFormat, I get ERR\_INITIALIZED error.  
Maybe I misunderstood the use of the function?

```
// Global Settings
if (Factory.System_Create(out FMODsystem) != RESULT.OK) return false;
if (FMODsystem.getVersion(out uint version) != RESULT.OK) return false;
if (version < VERSION.number) return false;
if (FMODsystem.init(16, INITFLAGS.NORMAL, (IntPtr)null) != RESULT.OK) 
    return false;

int samplerate, numrawspeakers;
SPEAKERMODE speakermode;
RESULT res;

res = FMODsystem.getSoftwareFormat(out samplerate, 
    out speakermode, out numrawspeakers);
res = FMODsystem.setSoftwareFormat(44100, speakermode, numrawspeakers);

res == ERR_INITIALIZED
```

---

<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 28, 2020, 11:48pm UTC](https://qa.fmod.com/t/resample-48000-to-44100/16012/4 "2020-07-28T23:48:43Z")

</div>

You just need to call System::setSoftwareFormat before System::init and it should work.

---

<div class="post-metadata">

**Author:** ![LoVic](https://avatars.discourse-cdn.com/v4/letter/l/77aa72/32.png) [@LoVic](https://qa.fmod.com/u/LoVic)\
**Post date:** [July 29, 2020, 2:58am UTC](https://qa.fmod.com/t/resample-48000-to-44100/16012/5 "2020-07-29T02:58:02Z")

</div>

Thank. I will check it. 🙂

---

<div class="post-metadata">

**Author:** ![LoVic](https://avatars.discourse-cdn.com/v4/letter/l/77aa72/32.png) [@LoVic](https://qa.fmod.com/u/LoVic)\
**Post date:** [July 29, 2020, 6:10pm UTC](https://qa.fmod.com/t/resample-48000-to-44100/16012/6 "2020-07-29T18:10:50Z")

</div>

Thank! I have checked your solution. Everything is working.
