Re: We are developing a fps audio game using 3D sound (HRTF)

Hi Sanslash.

I admit I too had a bit of trouble figuring out if HRTF was indeed working at first. As far as I can tell that info tool doesn't actually seem to work, it still tells me "No HRTFs found". In the end the only way I was able to make absolutely certain that it was working was by querying the HRTF status within my actual program and having it print out to the console. This might be somewhat inconvenient for you if you don't typically write in Java and don't already have the latest LWJGL nightly build but the best I can do is paste you some code to run in your Java IDE of choice which will let you know for certain if you do indeed have HRTF installed.

import org.lwjgl.BufferUtils;
import org.lwjgl.openal.*;
import org.lwjgl.openal.SOFTHRTF;
import static org.lwjgl.openal.ALC10.*;
import static org.lwjgl.system.MemoryUtil.*;

import java.nio.ByteBuffer;
import jav a.nio.IntBuffer;


public class Main {

    public static void main(String[] args) {

        long device = alcOpenDevice((ByteBuffer) null);
        if (device==NULL) {
            throw new IllegalStateException("Error: failed to open the default device");
        }

        ALCCapabilities deviceCaps = ALC.createCapabilities(device);

        IntBuffer contextBuf = (IntBuffer) BufferUtils.createIntBuffer(3).put(new int[]{SOFTHRTF.ALC_HRTF_SOFT, ALC_TRUE, 0}).flip();

        System.out.println("OpenALC10: " + deviceCaps.OpenALC10);
        System.out.println("OpenALC11: " + deviceCaps.OpenALC11);
        System.out.println("caps.ALC_EXT_EFX = " + deviceCaps.ALC_EXT_EFX);

  & nbsp;     System.out.println("\nNum HRTF specifiers = 2: " + (alcGetInteger(device, SOFTHRTF.ALC_NUM_HRTF_SPECIFIERS_SOFT) == 2));

        long context = alcCreateContext(device, contextBuf);
        alcMakeContextCurrent(context);

        System.out.println("Sample rate: " + alcGetString(device, SOFTHRTF.ALC_HRTF_SPECIFIER_SOFT));
        int response = alcGetInteger(device, SOFTHRTF.ALC_HRTF_STATUS_SOFT);
        System.out.println("HRTF enabled: " + (response == SOFTHRTF.ALC_HRTF_ENABLED_SOFT || response == SOFTHRTF.ALC_HRTF_REQUIRED_SOFT));
        System.out.println("HRTF state: 0x" + Integer.toHexString(response)+ "\n");

        AL.createCapabilities(deviceCaps);
        alcDestroyContext(context);
    & nbsp;   alcCloseDevice(device);
    }
}

I hope this is helpful.

_______________________________________________
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ishan Dhami via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : CosmicNeanderthal via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : CosmicNeanderthal via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ishan Dhami via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : sanslash332 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : CosmicNeanderthal via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : CosmicNeanderthal via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : CosmicNeanderthal via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : sanslash332 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : CosmicNeanderthal via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : CosmicNeanderthal via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : sanslash332 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : CosmicNeanderthal via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : sanslash332 via Audiogames-reflector

Reply via email to