FSOUND_Init(44100, 32, 0);
sample = FSOUND_Sample_Load(FSOUND_FREE,"s2.wav",FSOUND_ENABLEFX,0);
efect = FSOUND_FX_Enable(0,FSOUND_FX_ECHO);[/code:218v04dv]
Why sample is NULL and efect is -1? Whats the problem…it seems to be all in order. If I take out FSOUND_ENABLEFX and put there 0, the sound plays but efect stills -1. Why?
- filami asked 15 years ago
Thanks for the reply…Seems that I hunderstand now what I was doing wrong! But I still have a problem:
sample = FSOUND_Sample_Load(FSOUND_FREE,”beat.wav”,FSOUND_ENABLEFX | FSOUND_HW2D,0);
The sound has 5 seconds so I don’t thinck this time the problem is the the sample being too smaal (why we cannot do fx with small sounds anyway?)
As you can see, this time I’ve included the FSOUND_HW2D, but the sample is still 0x0000000!! If I take out the FSOUND_ENABLEFX, the sample is loaded and can be played! I don’t understand! Is my hardware that is not enought? What’s the minimuns spects to do that?
No, It’s not working!! It says that cannot create a hardware sound buffer!! But I remenber this working once!! Maybe is some configuration in my computer….hummm….I remenber….this worked on win98 but now I am at XP!! I thinck I didn’t make any reconfiguration….cold be that?
I’ve realized another error:
FSOUND_Init(44100, 32, FSOUND_INIT_ENABLEOUTPUTFX)
seems that I must put FSOUND_INIT_ENABLEOUTPUTFX to make effects working. Unfortantly, is that is making the program to fail!!
Definitly…It worked once but is not working anymore. I’ve taked out the ENABLE_FX from the samples in the DSP example only to see how the program looks like and I’ve recognized it!! I’ve ran it!! But is not running now. What is your advice for this case!! I have a Sound Blaster PCI 64 (is some what old but still is good). My idea by now is to reinstal the drivers, reinstal the dirext 8.1. Then I will instal the EAX demo that comes with the card’s drivers and see if it works!
If even then it don’t want to work, what should I do?
BTW: How did the guys from Valve Software make the reverbs and echo efects on Half Life? Definatly, they didn’t used DSound 8!!
Is only to say thanck to every one!!
The problem was in fact the drivers! I’ve reinstaled old drivers on the windows XP so the hardware allocation didn’t work. Now I have new one and it work.
I’ve ended in conclusion that my code was right and is working just fine now!!
One more thing:
What about playing the same efect with too samples at the same time?
FSOUND_SAMPLE* sample1 = FSOUND_LOAD….
FSOUND_SAMPLE* sample2 = FSOUND_LOAD….
int channel1 = FSOUND_Play(sample1)…..
int channel2 = FSOUND_Play(sample2)…..
int effect = FSNSOUND_Enable(channel1, ECHO)….
effect = FSNSOUND_Enable(channel2, ECHO)….
Is this possible or I must create a diferente echo for each channel?
Please login first to submit.