2012-01-24 18:11:41

Hi's.

You know what would be awesome? Being able to make any sound do something like this in a game.
But it's apparently so complicated that you need the cloak of Internet Mastery to know where to begin looking for how.

Psst, that recording was made using the sound max digital audio test program in the control panel of my Windows ME laptop. Which is at least ten years old now.
That is the only setting in which I've been able to do anything like this, and just recording sounds looping in circles around diferent axes just... doesn't do it, ya know?

Is there a way to do this sort of thing that doesn't involve brains liquifying?

看過來!
"If you want utopia but reality gives you Lovecraft, you don't give up, you carve your utopia out of the corpses of dead gods."
MaxAngor wrote:
    George... Don't do that.

2012-01-24 18:18:05

Very cool!  Hmm, I wonder how exactly this effect is created.  I will scratch my chin and ponder greatly.

- Aprone
Please try out my games and programs:
Aprone's software

2012-01-24 19:23:46

According to the little English I've been able to understand in my searches, "Head-related transfer function". Which... doesn't explain a whole lot. I suppose that it takes the head into consideration...

看過來!
"If you want utopia but reality gives you Lovecraft, you don't give up, you carve your utopia out of the corpses of dead gods."
MaxAngor wrote:
    George... Don't do that.

2012-01-24 19:34:26

I'd like to do such things too.

I post sounds I record to freesound. Click here to visit my freesound page
I usually post game recordings to anyaudio. Click here to visit my anyaudio page

2012-01-24 23:05:44

That, is awsome! How to do it though, I really do not know! However, I would really like to be able to create something with those sorts of sounds.

It is better to remain silent and be thought a fool, than to open your mouth and remove all doubt. -Abraham Lincoln

2012-01-25 00:13:13

I use to have an effect processor thingy that would pan things around in 3 d.
It was for audacity but I lost it.

2012-01-25 03:02:55 (edited by MasterChief 2012-01-25 03:07:31)

Hi there
there's program called
Adobe Audition
I do love use it
this program can make 3d sounds
and other Effects
for me, it's better than Goldwav
goldwav can not make any 3d sounds
The problem is
Adobe Audition is not free

Omar Alvarado:
did you Remember the name of this Effect?
I love collecting effects
that's makes 3d sounds
thank's

2012-01-25 04:50:09

Well, if we are talking about virtual 3d in games the easiest API I've seen to do this is FMOD Ex. If you are considering a free project you can use FMOD Ex for free in your games, but if you are thinking of something commercial then it depends on the price of your game and size of distribution.

However, I've listened to their 3d code example and it seems fairly realistic even on a set of 2d headphones. I think it might be worth looking into if you are thinking of using virtual 3d audio in a game.

Sincerely,
Thomas Ward
USA Games Interactive
http://www.usagamesinteractive.com

2012-01-25 09:13:59

Wow. I might try it out.

It is better to remain silent and be thought a fool, than to open your mouth and remove all doubt. -Abraham Lincoln

2012-01-25 09:19:38 (edited by CAE_Jones 2012-01-25 09:42:59)

I've looked into fmodEx a couple times, but didn't have any success understanding how to use it.
That and I was trying to use it with java, which involves the extra layer of NativeFmodEx.

[edit]
I just took another look at the _3d example in the NativeFmodEx sdk.
37 import statements? Not a good start...
Even skipping around all the gui code and the numerous checks for errors and soundcard settings, just loading the sounds looks like this:

            ErrorCheck(result = system.getDriverInfo(0, buffer, buffer.capacity(), null));
            String name = BufferUtils.toString(buffer);

            if(name.equals("SigmaTel")) { /* Sigmatel sound devices crackle for some reason if the format is PCM 16bit.  PCM floating point output seems to solve it. */
                ErrorCheck(result = system.setSoftwareFormat(48000, FMOD_SOUND_FORMAT_PCMFLOAT, 0, 0, FMOD_DSP_RESAMPLER_LINEAR));
            }
        }

        result = system.init(100, FMOD_INIT_NORMAL, null);
        if(result == FMOD_ERR_OUTPUT_CREATEBUFFER) { /* Ok, the speaker mode selected isn't supported by this soundcard.  Switch it back to stereo... */
            ErrorCheck(result = system.setSpeakerMode(FMOD_SPEAKERMODE_STEREO));
            ErrorCheck(result = system.init(100, FMOD_INIT_NORMAL, null));/* ... and re-init. */
        }

        /*
         * Set the distance units. (meters/feet etc).
         */
        ErrorCheck(result = system.set3DSettings(1.0f, DISTANCEFACTOR, 1.0f));

        /*
         * Load some sounds
         */
        soundBuffer = Medias.loadMediaIntoMemory("/Media/drumloop.wav");
        exinfo = FMOD_CREATESOUNDEXINFO.create();
        exinfo.setLength(soundBuffer.capacity());
        ErrorCheck(result = system.createSound(soundBuffer, FMOD_3D | FMOD_OPENMEMORY, exinfo, sound1));
        ErrorCheck(result = sound1.set3DMinMaxDistance(0.5f * DISTANCEFACTOR, 5000.0f * DISTANCEFACTOR));
        ErrorCheck(result = sound1.setMode(FMOD_LOOP_NORMAL));
        soundBuffer = null;
        exinfo.release();

        soundBuffer = Medias.loadMediaIntoMemory("/Media/jaguar.wav");
        exinfo = FMOD_CREATESOUNDEXINFO.create();
        exinfo.setLength(soundBuffer.capacity());
        ErrorCheck(result = system.createSound(soundBuffer, FMOD_3D | FMOD_OPENMEMORY, exinfo, sound2));
        ErrorCheck(result = sound2.set3DMinMaxDistance(0.5f * DISTANCEFACTOR, 5000.0f * DISTANCEFACTOR));
        ErrorCheck(result = sound2.setMode(FMOD_LOOP_NORMAL));
        soundBuffer = null;
        exinfo.release();

        soundBuffer = Medias.loadMediaIntoMemory("/Media/swish.wav");
        exinfo = FMOD_CREATESOUNDEXINFO.create();
        exinfo.setLength(soundBuffer.capacity());
        ErrorCheck(result = system.createSound(soundBuffer, FMOD_SOFTWARE | FMOD_2D | FMOD_OPENMEMORY, exinfo, sound3));
        soundBuffer = null;
        exinfo.release();

        /*
         * Play sounds at certain positions
         */
        {
            FMOD_VECTOR pos = FMOD_VECTOR.create(-10.0f * DISTANCEFACTOR, 0.0f, 0.0f);
            FMOD_VECTOR vel = FMOD_VECTOR.create(0.0f, 0.0f, 0.0f);

            ErrorCheck(result = system.playSound(FMOD_CHANNEL_FREE, sound1, true, channel1));
            ErrorCheck(result = channel1.set3DAttributes(pos, vel));
            ErrorCheck(result = channel1.setPaused(false));
        }

        {
            FMOD_VECTOR pos = FMOD_VECTOR.create(15.0f * DISTANCEFACTOR, 0.0f, 0.0f);
            FMOD_VECTOR vel = FMOD_VECTOR.create(0.0f, 0.0f, 0.0f);

            ErrorCheck(result = system.playSound(FMOD_CHANNEL_FREE, sound2, true, channel2));
            ErrorCheck(result = channel2.set3DAttributes(pos, vel));
            ErrorCheck(result = channel2.setPaused(false));
        }

        /*
         * Display help
         */
        {
            int num3d = 0, num2d = 0;

            IntBuffer iBuffer = newIntBuffer(1);
            ErrorCheck(result = system.getHardwareChannels(buffer.asIntBuffer(), iBuffer, null));
            num3d = buffer.getInt(0);
            num2d = iBuffer.get(0);

            printf("Hardware 2D channels : %d\n", num2d);
            printf("Hardware 3D channels : %d\n", num3d);
        }

        print("=========================================================================\n");
        print("Press 1        Pause/Unpause 16bit 3D sound at any time\n");
        print("      2        Pause/Unpause 8bit 3D sound at any time\n");
        print("      3        Play 16bit STEREO 2D sound at any time\n");
        print("      <        Move listener left (in still mode)\n");
        print("      >        Move listener right (in still mode)\n");
        print("      SPACE    Stop/Start listener automatic movement\n");
        print("      E        Quit\n");
        print("=========================================================================\n");

This makes me want to go play around with my SoundPlayer and SoundBuffer classes just so I can do something halfway complicated without my head exploding. lol

If BGT or G3d can eventually do something like this without so much... pain, yay!
And, yeah, the same thing, minus the 3d, in BGT looks like this:

sound sound1; sound sound2; sound sound3;
sound1.load("media/snd1.wav");
sound2.load("media.snd2.wav");
 sound3.load("media/snd3.wav");
 int pan_step=1; int volume_step=1; double behind_pitch_decrease=1.0;
 position_sound_2d(sound1, 0, 0, random(-5, 5), random(-5, 5), pan_step, volume_step, behind_pitch_decrease);
 position_sound_2d(sound2, 0, 0, random(-5, 5), random(-5, 5), pan_step, volume_step, behind_pitch_decrease);
 position_sound_2d(sound3, 0, 0, random(-5, 5), random(-5, 5), pan_step, volume_step, behind_pitch_decrease);
 sound1.play_looped(); sound2.play_looped(); sound3.play_looped();

Hopefully I can order either the light or pro single license for BGT in the next week...
[/edit]

看過來!
"If you want utopia but reality gives you Lovecraft, you don't give up, you carve your utopia out of the corpses of dead gods."
MaxAngor wrote:
    George... Don't do that.

2012-01-25 10:50:12

I'd like to use 3d sound like GMA games. But I couldn't do it before.
Btw, does anyone know the dll which is able to play ogg and able to change pan volume and pitch, and able to load sounds from memory?

I don't speak as good as I write, and I don't listen as good as I speak.

2012-01-25 14:53:16

Well, if you think FMOD Ex is bad you should look at XAudio2 and DirectSound. they are a whole lot more complex because you have to write your own load functions for wave files, and I still can't make heads or tales out of the 3d audio example for XAudio2. At least I understand what the code examples for FMOD Ex are doing.

FMOD Ex isn't really all that complicated, but all the error checks and so on makes it look worse than it really is. Still, the only way you can simplify the process with any sound API be it OpenAL, FMOD Ex, XAudio2, whatever is to write your own wrapper class that performs all this behind the scenes. For example, in the Genesis engine I have a class called Audio that does everything behind the scenes. Here is a C++ example of how G3D works.

#include "audio.h"

        static int main ()
        {

            // Initialize the audio device
            // and play a sound
            AUDIO::InitializeAudio ();
            AUDIO::SoundOpen (1, "Sounds/Sound.wav");
            AUDIO::SoundPlay (1, false);
AUDIO::SoundPosition (1, 5, 0, 5);

            while (AUDIO::SoundPlaying (1))
                        {
                // Wait for the sound to stop
            }

            // Shut down the audio device
AUDIO::SoundClose (1);
            AUDIO::KillAudio ();

            // Exit the program
            return 0;
        }

The above code example basically creates an audio object for sound playback, and then initializes it when Audio::InitializeAudio() is called. I then load a sound into the first audio buffer, start it playing, and give it a vector (5, 0, 5)  which would move the sound to the north-east. When the sound fineshes it kills the audio device and exits the program. regardless if the audio class is using FMOD Ex, DirectSound, or XAudio2 the fact is mmy wrapper class does all the work. Just one of the wonderful things about object oriented programming. Yay!

Something else that makes FMOD the ideal choice is supported sound formats. The way OpenAL, DirectSound, and XAudio2 work is you are responcible for your own load functions. If you want to open an mp3 you've got to program it. If you want to play an ogg file you have to program it. If you want to play a PCM wav file you have to program it. With FMOD it has its own load functions that can load mp3, ogg, wav, WMA, and several other sound formats by default. The beauty of it all is that FMOD will ssave you a lot of time writing custom load functions for compressed and uncompressed file types. For free games there are no better options than FMOD in my book.

Sincerely,
Thomas Ward
USA Games Interactive
http://www.usagamesinteractive.com

2012-01-25 15:13:41

hi.
as talking about the above sound, it might be due to effect of something called binaural recording, just like that virtual barber shop if anyone remembers it.
just search about it on google, and you'll get quite a lot on it, though.

well, once i downloaded a file of such type, i'd paste to dropbox for others to listen if they want, and that recording is somewhat similar to the above one.
here

another recording of this type.
here

regards
sid.

He picked up the wrench and broke the guy’s wrist with it, one, and then the other wrist, two, and turned back and did the same to the guy who had held the hammer, three, four. The two men were somebody’s weapons, consciously deployed, and no soldier left an enemy’s abandoned ordnance on the field in working order.

2012-01-25 15:39:49

Where can I download FMODX? I try to find it, but I couldn't do that.

I don't speak as good as I write, and I don't listen as good as I speak.

2012-01-25 15:52:20

Sid, that recording was me putting a normal wave file into the Sound Max test program and telling it to play vertical circles. So I think it was handled by the sound device.


The G3D example doesn't use up all of my brain's processing power, therefore I like it much. smile
I decided pretty early on that if I were to use fmodEx, I'd need wrapper classes for it. It's just painful enough trying to dissect the examples that I haven't even started trying.
(Well, and I get an error message when I try to run the examples, and of course it's not an accessible message.)

Yukio, try
http://fmod.org
And if the dll isn't there, it should be here:
http://www.dll-files.com/dllindex/dll-f … tml?fmodex

看過來!
"If you want utopia but reality gives you Lovecraft, you don't give up, you carve your utopia out of the corpses of dead gods."
MaxAngor wrote:
    George... Don't do that.

2012-01-25 15:52:33

Hi,

The FMOD Ex API can be found at
http://www.fmodex.com
along with documentation and source examples. If you get the full setup you should get the programming guide, headers, libraries, and source examples all in one.

Sincerely,
Thomas Ward
USA Games Interactive
http://www.usagamesinteractive.com

2012-01-27 15:54:52

Thanks. I'll try it tomorrow.

I don't speak as good as I write, and I don't listen as good as I speak.