# Unity CreateSound Error : ERR\_VERSION The version of this file format is not supported

**URL:** https://qa.fmod.com/t/unity-createsound-error-err-version-the-version-of-this-file-format-is-not-supported/20756
**Category:** Unity
**Created:** [October 10, 2023, 12:58pm UTC](https://qa.fmod.com/t/unity-createsound-error-err-version-the-version-of-this-file-format-is-not-supported/20756 "2023-10-10T12:58:05Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![firenonsuch](https://avatars.discourse-cdn.com/v4/letter/f/f4b2a3/32.png) [@firenonsuch](https://qa.fmod.com/u/firenonsuch)
#### Post date: [October 10, 2023, 12:58pm UTC](https://qa.fmod.com/t/unity-createsound-error-err-version-the-version-of-this-file-format-is-not-supported/20756/1 "2023-10-10T12:58:05Z")

</div>

Hello,

I am a game developer, and I am quite familiar with integrating FMOD in Unity. However, recently, I have encountered a strange issue when trying to load encrypted FSB files in Unity.

When using the fmodSystem.createSound function to load audio, sometimes it succeeds in reading the audio, but other times it fails with an ERR\_VERSION error, which is quite puzzling.

I am using Unity version 2021.3.21f1, FMOD Studio version 2.02, and FMOD Engine version 2.02, and all the tool versions are perfectly matched!

Here is my code:

```auto

CREATESOUNDEXINFO exinfo = new CREATESOUNDEXINFO();
byte[] encryptionKeyBytes = System.Text.Encoding.UTF8.GetBytes(encryptionKey);
exinfo.encryptionkey = Marshal.AllocHGlobal(encryptionKeyBytes.Length);                         
Marshal.Copy(encryptionKeyBytes, 0, exinfo.encryptionkey, encryptionKeyBytes.Length);
exinfo.cbsize = Marshal.SizeOf(exinfo);
res = fmodSystem.createSound(path, FMOD.MODE.CREATESTREAM, ref exinfo, out curFSBSound);
Marshal.FreeHGlobal(exinfo.encryptionkey); 

```

Any help or insight into resolving this issue would be greatly appreciated!

---

<div class="post-metadata">

### Author: ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)
#### Post date: [October 11, 2023, 11:01pm UTC](https://qa.fmod.com/t/unity-createsound-error-err-version-the-version-of-this-file-format-is-not-supported/20756/3 "2023-10-11T23:01:51Z")

</div>

Hi,

Could I get some more info:

- How are you building the FSB’s, are you using `FSBuild_Build` or FMOD Soundbank generator?
- Could I get the minor version of FMOD you are using `2.02.XX`
- Have you installed the FMOD Unity Integration or are you just using the FMOD Engine?

---

<div class="post-metadata">

### Author: ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)
#### Post date: [October 18, 2023, 3:50am UTC](https://qa.fmod.com/t/unity-createsound-error-err-version-the-version-of-this-file-format-is-not-supported/20756/5 "2023-10-18T03:50:00Z")

</div>

Hi,

The issue is you have to account for the null terminator in the encryption key. If you check `Marshal.PtrToStringAnsi(exinfo.encryptionkey)` you will see that sometimes your key will have extra letters or symbols following it as the code is not aware where to cut off the string.

A solution is having a look at our implementation of `byteFromString()` function in `fmod.cs` which outlines how to get the bytes and implement a null terminator. I simply copied the function into my own class and called it to correctly convert my key.

Hope this helps!

---

<div class="post-metadata">

### Author: ![firenonsuch](https://avatars.discourse-cdn.com/v4/letter/f/f4b2a3/32.png) [@firenonsuch](https://qa.fmod.com/u/firenonsuch)
#### Post date: [October 20, 2023, 1:05pm UTC](https://qa.fmod.com/t/unity-createsound-error-err-version-the-version-of-this-file-format-is-not-supported/20756/6 "2023-10-20T13:05:33Z")

</div>

Thank you for your help. The problem has been resolved
