PDA

View Full Version : Sound



Leyder Dylan
08-03-2000, 06:29 AM
Hi,

How can I play lots of sound at the same time. PlaySound() is not enough, it can only play one sound.

Someone knows a librairy ?

shawge
08-03-2000, 06:37 AM
OpenAL, BASS, or FMOD to name a few.

Leyder Dylan
08-03-2000, 07:02 AM
And, where can I found it ?

Leyder Dylan
08-03-2000, 07:08 AM
Sorry,
http://www.openal.org/

ngill
08-03-2000, 07:38 AM
good luck at trying to get it to work!! Because I sure haven't... probably because I am new to this sort of thing... but if you do get openAL working, e-mail me, ok??

personally I'd try FMOD or BASS. Because the API doesn't change every month like OpenAL. It's really not stable. Yet.

Leyder Dylan
08-03-2000, 08:18 AM
Sorry, I can't use it.
I dont't arrive to use it.

Help me with another librairy please

MikeC
08-03-2000, 09:19 AM
Oh, I'm glad it's not just me... I think I've tried every OpenAL snapshot they've released, and never got any of the demos to work.

OK, it's still in development. Fine. But I do wish they'd splash some big "WARNING PRE-ALPHA" signs on their website, or by the time the finished thing appears most of their potential users will have given up on it.

Offtopic, I know...

Leyder Dylan
08-03-2000, 10:39 AM
Where can I found another librairy ?

shawge
08-03-2000, 10:47 AM
What about DirectSound?

Regarding OpenAL: I have not been able to get it to work as well http://www.opengl.org/discussion_boards/ubb/frown.gif and it is a shame as it appears to have so much potential.

MikeC
08-03-2000, 10:59 AM
DirectSound, ugh. Only works on Windows, very unstable in my experience, and personally I'd rather be hurled naked into a tub full of starving elephant leeches than program to a COM API ever again. But then maybe I'm just kinky that way.

FMOD is at http://www.fmod.org/ - it's not open source like OpenAL, but it looks easy to use, the demos work, and I think there's a Linux port in the works.

Leyder Dylan
08-03-2000, 11:15 AM
Hi,

Thanks to all for your help. I'll try FMOD.

Leyder Dylan
08-03-2000, 11:20 AM
Hmm, it's look like easy to use, powerful.

I hope that I can use it!

ngill
08-03-2000, 10:25 PM
from the FMOD tutorials:
"FMOD Uses a left handed coordinate system, (x = right, y = up, z = forwards), which is the same as DirectSound3D, A3D, and OpenGL"

isn't z negative as we look ahead, and positive behind us?? That seems to be opposite of FMOD... but they say it is not... what's really true?

Rob The Bloke
08-04-2000, 11:53 AM
Make some basic axes with your fingers on your right and left hands.

You'll notice that the one on the right has a different orientation to the one on the left. Your initial camera position has nothing to do with it.

You usually find that if you look through maths books to do with vectors and planes, they can use either. Don't worry about it too much, who really cares? (unless someone starts writing functions that use the wrong orientation.... but you'll soon know)

Leyder Dylan
08-05-2000, 07:39 AM
Hi,

I can arrive to play a sound with FMOD under Windows 98, OpenGL.

It's a simply WAV but I can play that.
Anyone can make a copy/paste of code for me ?

Thanks

ngill
08-05-2000, 10:22 PM
#include <iostream.h>
#include <fmod.h>
#include <fmod_errors.h>
#include <Windows.h> //for Sleep()

int main()
{
FSOUND_SAMPLE *samp;

FSOUND_Init(44100, 64, 0);

samp = FSOUND_Sample_LoadWav(FSOUND_FREE, "C:/windows/media/chimes.wav", FSOUND_HW3D | FSOUND_LOOP_NORMAL); //load samp
cout << "You should here the sound now!" << endl;

FSOUND_PlaySound(FSOUND_FREE, samp); // play samp
Sleep(700); //chimes is ~0.63 seconds long, we wanna wait so we can hear the sound before we shutdown FSOUND

FSOUND_Sample_Free(samp);
FSOUND_Close();

return 0;
}

Leyder Dylan
08-06-2000, 07:21 AM
Hi,

Thanks a million for your help !

Leyder Dylan
08-07-2000, 10:38 AM
Hi,

Your code works, thanks.

But a question, how can I play a sound and moving in my game in the same time ?
Bucause, with your code, it plays the sound but I can do anything while it plays the sound. Anyone wanna help me ?

REM : I use FMOD

ngill
08-07-2000, 11:38 AM
take out the Sleep() call... I think that should do it, I haven't really messed with around with FMOD (yet), but I plan to soon.

Leyder Dylan
08-07-2000, 11:46 AM
Hi,

If I don't use Sleep, it don't works.
The function "PlaySound()" of Microsoft has a params called "ASYNC". But this simple function can play lots of wav in the same time.

ngill
08-07-2000, 11:40 PM
cut the:

FSOUND_Sample_Free(samp);
FSOUND_Close();

and then move it at the END of the program.

ngill
08-08-2000, 03:52 AM
make sure samp is a global

shehz
10-18-2001, 07:32 PM
Originally posted by ngill:



#include <iostream.h>
#include <fmod.h>
#include <fmod_errors.h>
#include <Windows.h> //for Sleep()

int main()
{
FSOUND_SAMPLE *samp;

FSOUND_Init(44100, 64, 0);

samp = FSOUND_Sample_LoadWav(FSOUND_FREE, "C:/windows/media/chimes.wav", FSOUND_HW3D | FSOUND_LOOP_NORMAL); //load samp
cout << "You should here the sound now!" << endl;

FSOUND_PlaySound(FSOUND_FREE, samp); // play samp
Sleep(700); //chimes is ~0.63 seconds long, we wanna wait so we can hear the sound before we shutdown FSOUND

FSOUND_Sample_Free(samp);
FSOUND_Close();

return 0;
}



Well I have to bring this up , I tried using this code and for some reason it doesnt work these are erors I'm facing right now


D:\Microsoft Visual C++ 6.0 Standard Edition\Project\sound\sound.cpp(10) : error C2065: 'FSOUND_Sample_LoadWav' : undeclared identifier

D:\Microsoft Visual C++ 6.0 Standard Edition\Project\sound\sound.cpp(10) : error C2440: '=' : cannot convert from 'int' to 'struct FSOUND_SAMPLE *'

can somebody point out where I'm doing wrong..

10-19-2001, 05:43 AM
try looking at the fmod.h header. FSOUND_Sample_LoadWav doesnt exist any more, it is now simply FSOUND_Sample_LoadFile (which autodetects the format)

Leyder Dylan
10-19-2001, 07:12 AM
It makes lots of month that I've resolved my problem. I've a little demo on my site for playing, WAV, MP3 sound with FMOD 3.33.
http://ibelgique.ifrance.com/Slug-Production

shehz
10-19-2001, 10:12 AM
Originally posted by firelight:
try looking at the fmod.h header. FSOUND_Sample_LoadWav doesnt exist any more, it is now simply FSOUND_Sample_LoadFile (which autodetects the format)

I think its FSOUND_Sample_Load either ways its not working..it says it doesnt acceppt 3 parameters what changes should I make in the above code in order to make it work?..

dylan thanks for the site but I still didnt get the Fmod sound, it seems lil complicated to me
if you could provide a simple code for playing the sound I would really appreciate..

thanks..

10-22-2001, 12:59 AM
its not complicated you're getting confused on standard C compiler errors. You have to pass it 3 parameters if the compiler asks you to! why? look at the function prototype in fmod.h, or try reading the documentation for the function!

cheers