How to play FSB5 files

I am a beginner in FMOD core API and I am trying to play FSB5 files using C #, but it is not working. I am not sure where the problem lies, and I hope someone can answer it for me. I would greatly appreciate it.

This is my code:

    FMOD.System system;
    FMOD.Factory.System_Create(out system);
    FMOD.Sound sound;
    FMOD.Channel channel;
    FMOD.ChannelGroup channelGroup;

    //string fsbFilePath = "E:\\vorbis.ogg"; //This has a sound
    string fsbFilePath = "E:\\wave_vorbis.fsb"; //This is No sound
    FileInfo fileInfo = new FileInfo(fsbFilePath);
    long fileSize = fileInfo.Length;

    system.init(32, FMOD.INITFLAGS.NORMAL, IntPtr.Zero);

    system.createChannelGroup("MyChannelGroup", out channelGroup);

    exinfo = new FMOD.CREATESOUNDEXINFO();
    exinfo.cbsize = Marshal.SizeOf(exinfo);
    exinfo.fileoffset = 0;
    exinfo.length = (uint)fileSize;
    exinfo.suggestedsoundtype = SOUND_TYPE.FSB;

    system.createSound(fsbFilePath, MODE.DEFAULT, ref exinfo, out sound);

    system.playSound(sound, channelGroup, false, out channel);

    Console.WriteLine("press any key to exit...");



What version of the FMOD integration are you using?

Could you please add an FMOD_RESULT to the FMOD function calls and log any that do not return FMOD_OK and post them here?

The issue may be you are trying to play the FSBank rather than the sub sounds attached to it.

Could you please try retrieving the sounds from the FSBank first using Sounds::getSubSound and passing that to the system.playSound() call?

Hope this helps!

that worked, thanks!

1 Like