# Working with subsounds / FSB

**URL:** https://qa.fmod.com/t/working-with-subsounds-fsb/11994
**Category:** FMOD Engine
**Created:** [July 21, 2015, 5:36pm UTC](https://qa.fmod.com/t/working-with-subsounds-fsb/11994 "2015-07-21T17:36:46Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![alfraprog](https://avatars.discourse-cdn.com/v4/letter/a/7bcc69/32.png) [@alfraprog](https://qa.fmod.com/u/alfraprog)
#### Post date: [July 21, 2015, 5:36pm UTC](https://qa.fmod.com/t/working-with-subsounds-fsb/11994/1 "2015-07-21T17:36:46Z")

</div>

Hi,

First of all, I’m on iOS.

I’m trying to understand how to use a FSB with multiple subsounds. I believe that I was able to use the command line to create an FSB containing 4 sounds on windows using fsbankcl with the following command:

“C:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\bin\fsbankcl.exe” -recursive -format fadpcm “C:\MyWavs” -o “C:\MyFSBs”

I copy this file into my project. So I then load it in FMOD with this code:

```
NSString *resourceName = @"test";
FMOD::Sound *sound[4];
NSString *filePath =[[NSBundle mainBundle]pathForResource:resourceName ofType: @"fsb"];
ERRCHECK(result);
int numsubsounds;
FMOD::Sound *fsbSound;
result = system->createSound([filePath UTF8String], FMOD_LOOP_NORMAL, 0, &fsbSound);
result = fsbSound->getNumSubSounds(&numsubsounds);

for (int i=0; i < numsubsounds; i++)
{
    fsbSound->getSubSound(i, &sound[i]);
}

```

So I can play the subsounds using my sound array but all I have is an index. How do I know what the original filename was? For instance, if one of my sounds was called ping.wav, how do I know if it’s on index 0, 1 2 or 3? Am I missing something?

Thanks in advance,

Alex

---

<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 21, 2015, 10:53pm UTC](https://qa.fmod.com/t/working-with-subsounds-fsb/11994/2 "2015-07-21T22:53:48Z")

</div>

You can make FSBank generate a header file that has all the indices of your FSB if you would like a compile time solution.

Otherwise you can call Sound::getName on each subsound to discover the original name at runtime.
