Which sound engine do you think better for irrlicht

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
jl0206
Posts: 55
Joined: Mon Jun 07, 2004 4:56 am

Which sound engine do you think better for irrlicht

Post by jl0206 »

I use fmod for irrlicht , what about you ??
openal or adiouhere or else??? which better????
fnolis

Post by fnolis »

I'm using openAL and it works fine! ;) Did my own wrapper though...
Acki

Post by Acki »

Yes, I'm using openAL for 3d sounds, too !!!
And for simple 2d - sounds (and music) i'm using Audiere...

CU, Acki
jl0206
Posts: 55
Joined: Mon Jun 07, 2004 4:56 am

Post by jl0206 »

Ok . But I use fmod
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

did you guys get positional audio to work in a 3d environment? can sounds be triggered as well? any chances of sharing your wrappers?

fingers crossed!!!!! :shock:
Image
Acki

Post by Acki »

afecelis wrote:did you guys get positional audio to work in a 3d environment? can sounds be triggered as well? any chances of sharing your wrappers?
Well, I did idt with OpenAl and it works !!! :)
It's a little bit tricky, if you never done it with OpenAl...
But if you once figured out, how it works, it's preatty simple... ;)
The main reason why it doesn't work is to use stereo waves !!!
Stereo waves will cause OpenAl to play the sound as background music (like Audiere) !!!
If you use a mono wave it works: the nearer the player to the sounds position, the louder the sound is played. If the player left or right of the sound, the sound will played on left/right speaker...

Now I created a DevCpp - template for my work with Irrlicht + OpenAl !!!
If you whant to, I'll send you this template (or just the source)... ;)

CU, Acki
Guest

Post by Guest »

I can share my wrapper, but I have not implemented the pan/3d part yet as I just started and have no use for it yet. Just tell me if you want to have a look...
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

@Acki: that would be great! What you say is more then true. Even engines like Quake work with mono wav sounds for 3d things, but the important thing is you got it working. Can your Devcpp wrapper be easily converted to vc++? I'd love to give it a try, so please feel free to send me your source and any sample at: afecelis@intercable.net.co just put "Openal source" in the subject so I won't think it's spam. And let me know if I can do anything for you from the samples I've posted. It's very basic stuff but perhaps there's something you may use.

@guest which I suppose is Jl0206 or fnolis: ditto. I'm very interested in anyone's work who has succeeded in adding audio. I achieved to use audiere, but as Acki said, all I got was a background music. I'm thinking more of getting paticular sound fx from different places in a map.

thnx guys. Hope to hear from you soon.

cheers
Image
bal
Posts: 829
Joined: Fri Jun 18, 2004 5:19 pm
Location: Geluwe, Belgium

Post by bal »

Acki, you may mail it to me also if you want :)
c$b$e$r$m$b@hotmail.com (remove the $'s ;))
jl0206
Posts: 55
Joined: Mon Jun 07, 2004 4:56 am

Post by jl0206 »

I'm just make midi or mp3 or wav in my project , and I also want to add 3d sound in it . But the fmod don't works . I have to download the openAl sdk and I never use it before . so Acki please mail me your source . my email:jl0206_80@hotmail.com THANKS :D
jl0206
Posts: 55
Joined: Mon Jun 07, 2004 4:56 am

afecelis

Post by jl0206 »

I'm not fnolis :D . I haven't work out the problem about 3d sound .
fnolis
Posts: 10
Joined: Thu Jun 24, 2004 8:25 am
Location: Sweden

Post by fnolis »

I'm "the guest" (now registered) .... sorry, forgot to write nick

* afecelis
My class is not yet done as I said before, cause I have only done what we needed for the moment. I will put it up later today...
fnolis
Posts: 10
Joined: Thu Jun 24, 2004 8:25 am
Location: Sweden

Post by fnolis »

Here [http://opensource.eye842.nu/uc_sound.src.tar.gz] you can download the source for the sound class. I have not altered it from how we use
it so you might want to change the namespace to your own name or completely remove it. There might be some other issues aswell, if so, I
can't figure them out right now...

Below is a short psedu-like example of usage. Should work, but I haven't tested it...

Code: Select all

#include <AL/al.h>
#include <AL/alc.h>
#include "sound.h"

#using namespace uc;

// Linking...
#ifdef WIN32
  #pragma comment(lib, "OpenAL32.lib")
  #pragma comment(lib, "ALut.lib")
#endif

void foo()
{
    Sound music;
    Sound sfxStart, sfxEngine;

    music.Load( "music.wav" );
    sfxStart.Load( "startengine.wav" );
    sfxEngine.Load( "engine.wav" );

    sfxEngine.SetLoop( true );

    music.Play( 1 );
    sfxStart.Play( 1 );
    while( sfxStart.IsPlaying() );
        sfxEngine.Play( 1 );
    // Free buffert
    sfxStart.Stop( 1 );
}

bool AudioInit( ALCdevice *device, ALCcontext *context )
{
    // Select prefered device (done with parameter NULL)
    if( (device = alcOpenDevice( NULL )) == NULL )
        return false;
    if( (context = alcCreateContext( device, NULL )) == NULL )
        return false;

    // Set active context
    alcGetError( device );
    alcMakeContextCurrent( context );
    if( alcGetError( device ) != ALC_NO_ERROR )
        return false;

    // Clear Error Code
    alGetError();
    alcGetError( device );

    return true;
}

void AudioShutdown( ALCdevice *device, ALCcontext *context )
{
    context = alcGetCurrentContext();
    device = alcGetContextsDevice( context );
    alcMakeContextCurrent( NULL );
    alcDestroyContext( context );
    alcCloseDevice( device );
}

int main( int argc, char* argv[] )
{
    ALCcontext *audioContext = NULL;
    ALCdevice *audioDevice = NULL;

// No sound available?
    if( !AudioInit( audioDevice, audioContext ) )
        return 1;

    foo();

    AudioShutdown( audioDevice, audioContext );

    return 0;
}
This is used by sound...

Code: Select all

bool file_exists( const char* path )
{
    FILE* fp = fopen( path, "r" );
    if( fp != NULL )
    {
        fclose( fp );
        return true;
    }
    return false;
}
Alot of cut and paste, but I guess that you figures out how it should work. Any questions just mail me. fnolis at home dot se
...and any suggestions to improve the class is welcome :)

BTW: The resume method does not work! It restarts the sound, I have mailed the openAL mailinglist but have not yet got a answer about why it does not continue.
Acki

Post by Acki »

Well,
bal and afecelis, sorry but
you didn't post your correct mail adresses !!!
I've got a mailer deamon when sending you my source... :?


If you still whant my code, post your correct mail adresses
or better: send me an mail to A_Buschhueter@gmx.de

CU, Acki
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

sorry! I'm also getting an error message trying to write at your email so send a copy to amp2engine@yahoo.com

yahoo mails seem not to have complicated problems.

thanks!!!
:D
Image
Post Reply