void SoundStartup( void ) { int32 status; // if they chose None lets return if (FXDevice == NumSoundCards) return; // Do special Sound Blaster, AWE32 stuff if ( ( FXDevice == SoundBlaster ) || ( FXDevice == Awe32 ) ) { int MaxVoices; int MaxBits; int MaxChannels; status = FX_SetupSoundBlaster ( BlasterConfig, (int *)&MaxVoices, (int *)&MaxBits, (int *)&MaxChannels ); } else { status = FX_Ok; } if ( status == FX_Ok ) { if ( eightytwofifty && numplayers > 1) { status = FX_Init( FXDevice, min( NumVoices,4 ), 1, 8, 8000 ); } else { status = FX_Init( FXDevice, NumVoices, NumChannels, NumBits, MixRate ); } if ( status == FX_Ok ) { FX_SetVolume( FXVolume ); if (ReverseStereo == 1) FX_SetReverseStereo(!FX_GetReverseStereo()); } } if ( status != FX_Ok ) soundexit("Error initializing sound."); status = FX_SetCallBack( TestCallBack ); if ( status != FX_Ok ) soundexit("Error initializing sound."); }
void SoundStartup(void) { int32_t status; void *initdata = 0; int fxdevicetype; // if they chose None lets return if (FXDevice < 0) { gs.FxOn = FALSE; return; } else if (FXDevice == 0) { fxdevicetype = ASS_AutoDetect; } else { fxdevicetype = FXDevice - 1; } #ifdef MIXERTYPEWIN initdata = (void *) win_gethwnd(); #endif //gs.FxOn = TRUE; status = FX_Init(fxdevicetype, NumVoices, NumChannels, NumBits, MixRate, initdata); if (status == FX_Ok) { FxInitialized = TRUE; FX_SetVolume(gs.SoundVolume); if (gs.FlipStereo) FX_SetReverseStereo(!FX_GetReverseStereo()); } if (status != FX_Ok) { buildprintf("Sound error: %s\n",FX_ErrorString(FX_Error)); } status = FX_SetCallBack(SoundCallBack); if (status != FX_Ok) { buildprintf("Sound error: %s\n",FX_ErrorString(FX_Error)); } }
int SD_Startup ( bool bombonerror ) { int status; int card; int voices; int channels; int bits; int i; extern bool IS8250; if (SD_Started==true) SD_Shutdown(); if ( ( FXMode < 0 ) || ( FXMode >= 11 ) ) { return( 0 ); } card = fxnums[ FXMode ]; if (card==-1) // Check if it is off return (0); switch (card) { case SoundScape: soundstart=W_GetNumForName("digistrt")+1; soundtype=fx_digital; break; default: Error("FX: Unsupported Card number %d",FXMode); break; } if ( soundtype == fx_digital ) { if ( SoundsRemapped == false ) { for( i = 0; i < SD_LASTSOUND; i++ ) { int snd; snd = sounds[ i ].snds[ fx_digital ]; if ( snd >= 0) { sounds[ i ].snds[ fx_digital ] = W_GetNumForName( W_GetNameForNum( snd + soundstart ) ); } } SoundsRemapped = true; } soundstart = 0; } voices = NumVoices; channels = NumChannels; bits = NumBits; if ( IS8250 ) { voices = max( voices, 4 ); channels = 1; bits = 8; } status=FX_Init( card, voices, channels, bits, 11025 ); if (status != FX_Ok) { if (bombonerror) { DeleteSoundFile (); Error( "%s\n", FX_ErrorString( status ) ); } return (status); } if (stereoreversed == true) { FX_SetReverseStereo(!FX_GetReverseStereo()); } FX_SetCallBack( SD_MakeCacheable ); remotestart=W_GetNumForName("remostrt")+1; SD_Started=true; FX_SetVolume (FXvolume); return (0); }