Hello, i’m student in informatics in the last year..and i make a projetc with FMOD en GTK.
And i must know how FMOD can works on Windows, LINUX, Mac, ….
is it use on windows Directsound, on Linux Linux OSS, …?
Can I have more explications, more informations about that?
Sorry for my ugly English, i’am french …
THX.
Edit : i want some informations about the structur of an MOD file, Stream File, CD file…
- Bens73 asked 15 years ago
- You must login to post comments
thank’s but can I have more details please….
- Bens73 answered 15 years ago
- You must login to post comments
First, Fmod is written in C, a powerfull and cross plateform langage. Then, for each Operating System, there is a sound driver supported by it (Linux : oss, alsa, esd; Windows : dsound, winmm; mac : euh … lol). And how Fmod can use different sound driver ? By coding a structure holding the same function for each OS and getting a pointer to it. Here is an example from my very alpha tiny craps sound library :
[code:338d172h]
/** Wich Output Mogg Will Use **/
enum MOGG_OUTPUT_DRIVER
{
MOGG_NO_SOUND,
MOGG_WINMM,
MOGG_DSOUND,
MOGG_ASIO,
MOGG_OSS,
MOGG_ESD,
MOGG_ALSA
};
typedef struct OUTPUT_DRIVER
{
char* m_sName; // driver description
char* m_sVersion; // driver version
bool (IsPresent)(void);
bool (Init)(void);
bool (LoadFile)(const char *file_name);
bool (Play)(void);
void (Pause)(void);
void (Stop)(void);
void (Close)(void);
void (Set_Volume)(int volume_percent);
void (*Set_Pan)(int pan_percent);
}OUTPUT_DRIVER;
// external symbol
MOGGAPI extern struct OUTPUT_DRIVER drv_nos; /* no sound /
MOGGAPI extern struct OUTPUT_DRIVER drv_dsound; / directsound /
MOGGAPI extern struct OUTPUT_DRIVER drv_winmm; / windows waveout /
MOGGAPI extern struct OUTPUT_DRIVER drv_asio; / asio output */
....
static OUTPUT_DRIVER *m_Driver; // Current Sound Driver
void mogg_Set_Driver(int driver)
{
switch (driver)
{
case MOGG_NO_SOUND:
{
m_Driver = &drv_nos;
break;
}
case MOGG_DSOUND:
{
m_Driver = &drv_dsound;
break;
}
case MOGG_WINMM:
{
m_Driver = &drv_winmm;
break;
}
case MOGG_ASIO:
{
m_Driver = &drv_asio;
break;
}
}
}
/** Internal Mogg Functions **/
bool mogg_IsPresent(void)
{
return m_Driver->IsPresent();
}
bool mogg_Init(void)
{
return m_Driver->Init();
}
bool mogg_LoadFile(const char *file_name)
{
return m_Driver->LoadFile(file_name);
}
...
[/code:338d172h]
Concerning the MOD file, Stream File, CD file structure, you can ask them to Brett (Fmod is not opensource) or search the forum to get, at least, the MOD structure.
- KarLKoX answered 15 years ago
- You must login to post comments
FMOD can work on all those different platforms because a seperate binary was built for each platform, and each of those binaries uses the native sound drivers (in Windows it uses DSound or WinMM for example) for its platform. Basic cross-platform stuff–nothing new to the programming community.
- Graduate Bruce 2002 answered 15 years ago
- You must login to post comments
Please login first to submit.