# Unity Android split by binary -\> no sound

**URL:** <https://qa.fmod.com/t/unity-android-split-by-binary-no-sound/12142>\
**Category:** Unity\
**Created:** [November 9, 2015, 5:25pm UTC](https://qa.fmod.com/t/unity-android-split-by-binary-no-sound/12142 "2015-11-09T17:25:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![HANSTUDIOS](https://avatars.discourse-cdn.com/v4/letter/h/3ec8ea/32.png) [@HANSTUDIOS](https://qa.fmod.com/u/HANSTUDIOS)\
**Post date:** [November 9, 2015, 5:25pm UTC](https://qa.fmod.com/t/unity-android-split-by-binary-no-sound/12142/1 "2015-11-09T17:25:26Z")

</div>

The normal unity android build (without split by binary) will work without problems. After spliting the apk and obb (as needed for \>100mb apps) the sound will not work. Do I have to change anything?

Thx.

---

<div class="post-metadata">

**Author:** ![nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nick1](https://qa.fmod.com/u/nick1)\
**Post date:** [November 10, 2015, 4:25am UTC](https://qa.fmod.com/t/unity-android-split-by-binary-no-sound/12142/2 "2015-11-10T04:25:29Z")

</div>

You’ll need to make some changes. The simplest would be to use Unity’s WWW class to read the .bank files from the assets folder within the OBB and write them into the Application.persistentDataPath folder. Then in FMOD\_Listener.cs change

```
bankPath = "file:///android_asset";

```

to

```
bankPath = Application.persistenDataPath;
```

---

<div class="post-metadata">

**Author:** ![HANSTUDIOS](https://avatars.discourse-cdn.com/v4/letter/h/3ec8ea/32.png) [@HANSTUDIOS](https://qa.fmod.com/u/HANSTUDIOS)\
**Post date:** [December 1, 2015, 4:51pm UTC](https://qa.fmod.com/t/unity-android-split-by-binary-no-sound/12142/3 "2015-12-01T16:51:21Z")

</div>

Thank you for helping out. We had some other priority bugs to fix :), so sorry for the late response.

Here is our code, free to use (do not forget to change banks ="", see answer above):

```
        WWW wwwAllBanksTextFile = new WWW( System.IO.Path.Combine( Application.streamingAssetsPath, "FMOD_bank_list.txt" ) );

        yield return wwwAllBanksTextFile;

        if( wwwAllBanksTextFile.error == null )
        {
            string[] banks = wwwAllBanksTextFile.text.Split( '\n' );

            foreach( string bank in banks ) 
            {
                if( bank.Length <= 0 )
                    continue;

                // try to open persistent file:
                WWW wwwBankPersistentFile = new WWW( System.IO.Path.Combine( Application.persistentDataPath, bank ) );

                yield return wwwBankPersistentFile;

                // if not found: not in persistent file space
                if( wwwBankPersistentFile.error != null )
                {
                    // Try to copy it from streaming assets path
                    WWW wwwBankTmp = new WWW( System.IO.Path.Combine( Application.streamingAssetsPath, bank ) );

                    yield return wwwBankTmp;

                    if( wwwBankTmp.error == null )
                    {
                        File.WriteAllBytes( System.IO.Path.Combine( Application.persistentDataPath, bank ), wwwBankTmp.bytes );
                    }
                    else
                    {
                        ErrorText.text += "ERROR 1002: " + bank + " file in streaming storage not found!\n";
                    }
                }
            }
        }
        else
        {
            ErrorText.text += "ERROR 1003: Bank list not found!\n";
        }
```

---

<div class="post-metadata">

**Author:** ![nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nick1](https://qa.fmod.com/u/nick1)\
**Post date:** [December 1, 2015, 11:17pm UTC](https://qa.fmod.com/t/unity-android-split-by-binary-no-sound/12142/4 "2015-12-01T23:17:38Z")

</div>

1.07.04 will have support for split binary out of the box in both the 2.0 and Legacy integrations.
