0
0

Hello
The 3D sound works well in the demo 3D.exe, but in my own project I have the message : Error creating hardware sound buffer.

The logs are :

[code:3rl66j6g]

You are using the DLL version 3.73

Selected Systeme :

Direct Sound
0 – Périphérique audio principal
* Driver supports hardware 3D sound!
* Driver supports EAX 2 reverb!
1 – SB Live! Wave Device
* Driver supports hardware 3D sound!

* Driver supports EAX 2 reverb!

Driver sélectionné = 0:

Driver capabilities

  • Driver supports hardware 3D sound!

– Driver supports EAX 2 reverb!

sndMoteur: Error creating hardware sound buffer.[/code:3rl66j6g]

and the code is :
[code:3rl66j6g]

fprintf(fp,"---------------------------------------------------------\n");    
fprintf(fp,"You are using the DLL version %.02f \n",FSOUND_GetVersion() );

FSOUND_SetOutput(FSOUND_OUTPUT_DSOUND); // config Direct Sound (son harware)
// FSOUND_SetOutput(FSOUND_OUTPUT_WINMM); config WinWM software only

fprintf(fp,"---------------------------------------------------------\n");    
fprintf(fp,"Selected Systeme : \n");    
fprintf(fp,"---------------------------------------------------------\n");    

switch (FSOUND_GetOutput())
{
    case FSOUND_OUTPUT_NOSOUND: fprintf(fp,"NoSound \n"); break;
    case FSOUND_OUTPUT_WINMM:   fprintf(fp,"Windows Multimedia Waveout \n"); break;
    case FSOUND_OUTPUT_DSOUND:  fprintf(fp,"Direct Sound \n"); break;
    case FSOUND_OUTPUT_ASIO:    fprintf(fp,"ASIO \n"); break;
};


printf("---------------------------------------------------------\n");    
printf("  Driver list: \n");    
printf("---------------------------------------------------------\n");    
for (int i=0; i < FSOUND_GetNumDrivers(); i++) 
{
    fprintf(fp,"%d - %s\n", i, FSOUND_GetDriverName(i));    // print driver names
    {
        unsigned int caps = 0;

        FSOUND_GetDriverCaps(i, &caps);
        if (caps & FSOUND_CAPS_HARDWARE) fprintf(fp,"  * Driver supports hardware 3D sound!\n");
        if (caps & FSOUND_CAPS_EAX2)     fprintf(fp,"  * Driver supports EAX 2 reverb!\n");
        if (caps & FSOUND_CAPS_EAX3)     fprintf(fp,"  * Driver supports EAX 3 reverb!\n");
    }
}
fprintf(fp,"---------------------------------------------------------\n");    
fprintf(fp,"Driver sélectionné = 0: \n");    
FSOUND_SetDriver(0);
{
    unsigned int caps = 0;

    FSOUND_GetDriverCaps(FSOUND_GetDriver(), &caps);

    fprintf(fp,"---------------------------------------------------------\n");    
    fprintf(fp,"Driver capabilities\n");
    fprintf(fp,"---------------------------------------------------------\n");    
    if (!caps) fprintf(fp,"- This driver will support software mode only.\n  It does not properly support 3D sound hardware.\n");
    if (caps & FSOUND_CAPS_HARDWARE) fprintf(fp,"- Driver supports hardware 3D sound!\n");
    if (caps & FSOUND_CAPS_EAX2)     fprintf(fp,"- Driver supports EAX 2 reverb!\n");
    if (caps & FSOUND_CAPS_EAX3)     fprintf(fp,"- Driver supports EAX 3 reverb!\n");
    fprintf(fp,"---------------------------------------------------------\n");    
}


FSOUND_SetMixer(FSOUND_MIXER_AUTODETECT);


if (!FSOUND_Init(44100, 32, 0))
    fprintf(fp,"Init: %s\n", FMOD_ErrorString(FSOUND_GetError()));


sndMoteur=FSOUND_Sample_Load(FSOUND_FREE,"../media/sounds/Engine.wav",FSOUND_HW3D,0,0);

if (!sndMoteur)
{
    fprintf(fp,"sndMoteur: %s\n", FMOD_ErrorString(FSOUND_GetError()));
    FSOUND_Sample_Free(sndMoteur);
}


// increasing mindistance makes it louder in 3d space
FSOUND_Sample_SetMinMaxDistance(sndMoteur, 4.0f, 10000.0f);
FSOUND_Sample_SetMode(sndMoteur, FSOUND_LOOP_NORMAL);

    float pos[3] = { 0,0,0 };
    float vel[3] = { 0,0,0 };
   int channel1;

channel1 = FSOUND_PlaySoundEx(FSOUND_FREE, sndMoteur, NULL, 1);
FSOUND_3D_SetAttributes(channel1, pos, vel);
FSOUND_SetVolume(channel1, 128);

[/code:3rl66j6g]

this code looks exactely like in the sample…
I don’t understand where the pb come from…
Thanks for your help

  • You must to post comments
0
0

That’s it!

Thanks for yuor help

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.