Bass.dll

Hello, could please help me, I am trying to include bass music system to my
sdl-based project and it doesn’t work - I am getting no erros or
warnings, the computer just restarts :frowning: (VC6, WinXP, SB Audigy)

hWnd = FindWindow(NULL, “…”); //this DOES work :slight_smile:

if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
fprintf(stderr, “Unable to init SDL: %s\n”, SDL_GetError());
MessageBox(hWnd, “Unable to init game engine”, “Error Message”, MB_OK|MB_ICONEXCLAMATION);
exit(1);
}

//try initializing the default device, at 44100hz stereo 16-bits

if (!BASS_Init(1,44100,0,hWnd,NULL)) {
// couldn’t initialize device, so use "no sound"
BASS_Init(0,44100,0,hWnd,NULL); }

I’ve never seen a lockup or restart with BASS/SDL. You should find out what
line is actually causing the restart by sprinkling some log writes and
flushes in there, or failed asserts. If this isn’t an SDL issue you’ll get
a better response by posting to the BASS forum on http://www.un4seen.com.

One problem might be you’re referencing the 2nd audio device when you pass
"1" as the first parameter to BASS_Init. 0 is the first audio device. -1 is
the default audio device (preferred). -2 is no sound.

FYI, this is what I use for retrieving the window handle, which I later
pass to BASS_Init:

SDL_SysWMinfo wmi;
SDL_VERSION (&wmi.version); // Version needs to be set for call to work
SDL_GetWMInfo (&wmi); // Retrieves the OS-dependent window handle
window = wmi.window;—
Eric W. Lund
Gearhand Studios
http://www.gearhand.com

At 06:01 PM 11/12/2003 +0200, you wrote:

Hello, could please help me, I am trying to include bass music system to my
sdl-based project and it doesn’t work - I am getting no erros or
warnings, the computer just restarts :frowning: (VC6, WinXP, SB Audigy)

hWnd = FindWindow(NULL, “…”); //this DOES work :slight_smile:

if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
fprintf(stderr, “Unable to init SDL: %s\n”, SDL_GetError());
MessageBox(hWnd, “Unable to init game engine”, “Error Message”,
MB_OK|MB_ICONEXCLAMATION);
exit(1);
}

//try initializing the default device, at 44100hz stereo 16-bits

if (!BASS_Init(1,44100,0,hWnd,NULL)) {
// couldn’t initialize device, so use "no sound"
BASS_Init(0,44100,0,hWnd,NULL); }