0
0

Hi, I was looking on forum, API doc and wiki but I didn’t find solution for this ( trivial ) problem. I have .DLS and couple sgt files that I want to play. I load DLS and when I want to load sgt file I get "FMOD_ERR_FORMAT" error. Here is my code that I got from FMOD wikipedia:

[code:rmb88o5n]void ERRCHECK(FMOD_RESULT result)
{
if (result != FMOD_OK)
{
printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result));
exit(-1);
}
}

int _tmain(int argc, _TCHAR* argv[])
{
FMOD_RESULT result = FMOD_OK;
FMOD::System *system = NULL;
FMOD::Sound *sound = NULL;
FMOD::Channel *channel = NULL;
int key = 0;
unsigned int version = 0;
FMOD_CREATESOUNDEXINFO soundExInfo;

/*
    Global Settings
*/
result = FMOD::System_Create(&system);
ERRCHECK(result);

result = system->getVersion(&version);
ERRCHECK(result);

if (version < FMOD_VERSION)
{
    printf("Error!  You are using an old version of FMOD %08x.  This program requires %08x\n", version, FMOD_VERSION);
    getch();
    return 0;
}

result = system->init(32, FMOD_INIT_NORMAL, NULL);
ERRCHECK(result);

/*Allocate memory for an instance of FMOD_CREATESOUNDEXINFO*/
/*This must be done to initialize the FMOD_CREATESOUNDEXINFO before midi playback*/
memset(&soundExInfo, 0, sizeof(FMOD_CREATESOUNDEXINFO));
soundExInfo.cbsize   = sizeof(FMOD_CREATESOUNDEXINFO);

/*Specify the .dls file*/
soundExInfo.dlsname  = "C:\\Data.dls";


result = system->createSound("C:\\SomeSong.sgt", 
    FMOD_DEFAULT, &soundExInfo, &sound);
ERRCHECK(result);

printf("===================================================================\n");
printf("Play midi Example.  Copyright (c) Firelight Technologies 2004-2007.\n");
printf("===================================================================\n");
printf("\n");
printf("Press '1' to Play the midi file\n");
printf("Press 'Esc' to quit\n");
printf("\n");

/*
    Main loop.
*/
do
{
    if (kbhit())
    {
        key = getch();

    if (key == '1')
    {
            result = system->playSound(FMOD_CHANNEL_FREE, sound, 0, &channel);
            ERRCHECK(result);

    }
    }

    system->update();

    {
        unsigned int ms = 0;
        unsigned int lenms = 0;
        bool         playing = 0;
        bool         paused = 0;
        int          channelsplaying = 0;

        if (channel)
        {
            result = channel->isPlaying(&playing);
            if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN))
            {
                ERRCHECK(result);
            }
        }

        printf("\r%s", playing ? "Playing" : "Stopped");
    }

    Sleep(10);

} while (key != 27);

printf("\n");

/*
    Shut down
*/
result = sound->release();
ERRCHECK(result);
result = system->release();
ERRCHECK(result);

return 0;

}[/code:rmb88o5n]

Thanks in advance.

  • You must to post comments
0
0

SGT isn’t a format I am familiar with, a quick Google tells me it comes from "Microsoft DirectMusic Producer". This is not a format that FMOD supports, the only format that can be used with a DLS file in FMOD is a MIDI file.

  • You must to post comments
0
0

Thanks for a quick reply. I found this answer before posting [url:p34230nk]http://www.fmod.org/forum/viewtopic.php?t=9741&highlight=sgt[/url:p34230nk] where it says that sgt files are supported in 3.75 version of fmod. Is support for sgt files dropped in 4.30 version of fmod?

  • You must to post comments
0
0

Yes, we no longer support SGT files in FMOD Ex.

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.