src/rfxgen.c
// Save .rfx sound parameters file
Save .rfx sound parameters file
Save . rfx sound parameters file
static void SaveWaveParams(WaveParams params, const char *fileName)
{
    if (IsFileExtension(GetExtension(fileName), ".rfx"))
    {
        FILE *rfxFile = fopen(fileName, "wb");
        if (rfxFile != NULL)
        {
            unsigned char signature[5] = "rFX ";
            unsigned short version = 200;
            unsigned short length = sizeof(WaveParams);
            fwrite(signature, 4, sizeof(unsigned char), rfxFile);
            fwrite(&version, 1, sizeof(unsigned short), rfxFile);
            fwrite(&length, 1, sizeof(unsigned short), rfxFile);
            fwrite(&params, 1, sizeof(WaveParams), rfxFile);
            fclose(rfxFile);
        }
    }
}
static void SaveWaveParams ( WaveParams params , const char * fileName ) { if ( IsFileExtension ( GetExtension ( fileName ) , " " ) ) { FILE * rfxFile = fopen ( fileName , " " ) ; if ( rfxFile != NULL ) { unsigned char signature [ 5 ] = " " ; unsigned short version = 200 ; unsigned short length = sizeof ( WaveParams ) ; fwrite ( signature , 4 , sizeof ( unsigned char ) , rfxFile ) ; fwrite ( & version , 1 , sizeof ( unsigned short ) , rfxFile ) ; fwrite ( & length , 1 , sizeof ( unsigned short ) , rfxFile ) ; fwrite ( & params , 1 , sizeof ( WaveParams ) , rfxFile ) ; fclose ( rfxFile ) ; } } }
Save .rfx sound parameters file
Save . rfx sound parameters file
// Fx Sound File Structure (.rfx) // ------------------------------------------------------ // Offset | Size  | Type       | Description // ------------------------------------------------------ // 0      | 4     | char       | Signature: "rFX " // 4      | 2     | short      | Version: 200 // 6      | 2     | short      | Data length: 96 bytes // 8      | 96    | WaveParams | Wave parameters // ------------------------------------------------------ // Write .rfx file header // Write wave generation parameters