# HG changeset patch # User Robert McIntyre # Date 1320045286 25200 # Node ID c969b04fa0dc4ba183c6787b1ff9b77b1fdb4fb9 # Parent 13d354e1184be289300e7d75f95aa305561d51cf working on divergence diff -r 13d354e1184b -r c969b04fa0dc divergence/pure --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/divergence/pure Mon Oct 31 00:14:46 2011 -0700 @@ -0,0 +1,96 @@ +OPENAL-AURELLEM: alc_init_config!! +creating new context via naddListener +-------- +main +0.0 +aux +0.0 +0 +I'm playing! <3 +-------- +main +6.408789E-4 +aux +6.408789E-4 +1 +-------- +main +0.0012512398 +aux +0.0012512398 +2 +-------- +main +0.0018921187 +aux +0.0018921187 +3 +-------- +main +0.0024719615 +aux +0.0024719615 +4 +-------- +main +0.0030212863 +aux +0.0030212863 +5 +-------- +main +0.003540093 +aux +0.003540093 +6 +-------- +main +0.004089418 +aux +0.004089418 +7 +-------- +main +0.0045471885 +aux +0.0045471885 +8 +-------- +main +0.004943923 +aux +0.004913405 +9 +-------- +main +0.004943923 +aux +0.004882887 +10 +-------- +main +0.004791333 +aux +0.004760815 +11 +-------- +main +0.0046082246 +aux +0.0045777066 +12 +-------- +main +0.0046082246 +aux +0.0045777066 +13 +-------- +main +0.0044556344 +aux +0.0044251163 +14 +AL lib: ALc.c:2463: alcCloseDevice(): destroying 1 Context(s) +AL lib: ALc.c:2069: alcDestroyContext(): deleting 64 Source(s) +AL lib: ALc.c:2471: alcCloseDevice(): deleting 1 Buffer(s) diff -r 13d354e1184b -r c969b04fa0dc divergence/pure-with-play --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/divergence/pure-with-play Mon Oct 31 00:14:46 2011 -0700 @@ -0,0 +1,96 @@ +OPENAL-AURELLEM: alc_init_config!! +creating new context via naddListener +-------- +main +0.0 +aux +0.0 +0 +I'm playing! <3 +-------- +main +6.408789E-4 +aux +6.408789E-4 +1 +-------- +main +0.0012512398 +aux +0.0012512398 +2 +-------- +main +0.0018921187 +aux +0.0018921187 +3 +-------- +main +0.0024719615 +aux +0.0024719615 +4 +-------- +main +0.0030212863 +aux +0.0030212863 +5 +-------- +main +0.003540093 +aux +0.003540093 +6 +-------- +main +0.004089418 +aux +0.004089418 +7 +-------- +main +0.0045471885 +aux +0.0045471885 +8 +-------- +main +0.004943923 +aux +0.004913405 +9 +-------- +main +0.004943923 +aux +0.004882887 +10 +-------- +main +0.004791333 +aux +0.004760815 +11 +-------- +main +0.0046082246 +aux +0.0045777066 +12 +-------- +main +0.0046082246 +aux +0.0045777066 +13 +-------- +main +0.0044556344 +aux +0.0044251163 +14 +AL lib: ALc.c:2463: alcCloseDevice(): destroying 1 Context(s) +AL lib: ALc.c:2069: alcDestroyContext(): deleting 64 Source(s) +AL lib: ALc.c:2471: alcCloseDevice(): deleting 1 Buffer(s) diff -r 13d354e1184b -r c969b04fa0dc divergence/pure2 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/divergence/pure2 Mon Oct 31 00:14:46 2011 -0700 @@ -0,0 +1,96 @@ +OPENAL-AURELLEM: alc_init_config!! +creating new context via naddListener +-------- +main +0.0 +aux +0.0 +0 +I'm playing! <3 +-------- +main +6.408789E-4 +aux +6.408789E-4 +1 +-------- +main +0.0012512398 +aux +0.0012512398 +2 +-------- +main +0.0018921187 +aux +0.0018921187 +3 +-------- +main +0.0024719615 +aux +0.0024719615 +4 +-------- +main +0.0030212863 +aux +0.0030212863 +5 +-------- +main +0.003540093 +aux +0.003540093 +6 +-------- +main +0.004089418 +aux +0.004089418 +7 +-------- +main +0.0045471885 +aux +0.0045471885 +8 +-------- +main +0.004943923 +aux +0.004913405 +9 +-------- +main +0.004943923 +aux +0.004882887 +10 +-------- +main +0.004791333 +aux +0.004760815 +11 +-------- +main +0.0046082246 +aux +0.0045777066 +12 +-------- +main +0.0046082246 +aux +0.0045777066 +13 +-------- +main +0.0044556344 +aux +0.0044251163 +14 +AL lib: ALc.c:2463: alcCloseDevice(): destroying 1 Context(s) +AL lib: ALc.c:2069: alcDestroyContext(): deleting 64 Source(s) +AL lib: ALc.c:2471: alcCloseDevice(): deleting 1 Buffer(s) diff -r 13d354e1184b -r c969b04fa0dc divergence/results.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/divergence/results.txt Mon Oct 31 00:14:46 2011 -0700 @@ -0,0 +1,21 @@ +sqr-1khz, a mono 16 bit sound file, diverges at sample 9 +haydn, a stereo 16 bit, does not diverge to 350 samples. +pure, mono 16 bit, diverges at sample 9 +sqr-10Hz, a mono 16 bit, diverges at sample 10 +sqr-100Hz also diverges at 10. + + + +calling audioRenderer.updateSourceParams in main update loop doesn't +change output + +audioRenderer.playSource vs source.play doesn't make a difference with +pure (and probably doesn't make any difference) + + +channel starts at -1, changes to 0 when playing starts, then stays the +same through divergence. + + + + diff -r 13d354e1184b -r c969b04fa0dc divergence/sqr-100Hz --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/divergence/sqr-100Hz Mon Oct 31 00:14:46 2011 -0700 @@ -0,0 +1,94 @@ +OPENAL-AURELLEM: alc_init_config!! +creating new context via naddListener +-------- +main +0.0 +aux +0.0 +0 +I'm playing! <3 +-------- +main +0.0046997787 +aux +0.0046997787 +1 +-------- +main +0.004943923 +aux +0.004943923 +2 +-------- +main +0.004943923 +aux +0.004943923 +3 +-------- +main +0.004852369 +aux +0.004852369 +4 +-------- +main +0.0046082246 +aux +0.0046082246 +5 +-------- +main +0.0046082246 +aux +0.0046082246 +6 +-------- +main +0.0045166705 +aux +0.0045166705 +7 +-------- +main +0.004303044 +aux +0.004303044 +8 +-------- +main +0.004303044 +aux +0.004303044 +9 +-------- +main +0.004150454 +aux +0.004119936 +10 +-------- +main +0.0040589 +aux +0.004028382 +11 +-------- +main +0.0040589 +aux +0.004028382 +12 +-------- +main +0.0039978637 +aux +0.0039673457 +13 +-------- +main +0.0038147555 +aux +0.0037842374 +14 + diff -r 13d354e1184b -r c969b04fa0dc divergence/sqr-1kHz-1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/divergence/sqr-1kHz-1 Mon Oct 31 00:14:46 2011 -0700 @@ -0,0 +1,77 @@ +creating new context via naddListener +-------- +main +0.0 +aux +0.0 +I'm playing! <3 +-------- +main +0.004791333 +aux +0.004791333 +-------- +main +0.004943923 +aux +0.004943923 +-------- +main +0.004943923 +aux +0.004943923 +-------- +main +0.004852369 +aux +0.004852369 +-------- +main +0.0046082246 +aux +0.0046082246 +-------- +main +0.0044861524 +aux +0.0044861524 +-------- +main +0.0044861524 +aux +0.0044861524 +-------- +main +0.004303044 +aux +0.004303044 +-------- +main +0.004242008 +aux +0.004180972 +-------- +main +0.004242008 +aux +0.004180972 +-------- +main +0.004150454 +aux +0.004119936 +-------- +main +0.0039673457 +aux +0.0039368276 +-------- +main +0.0039673457 +aux +0.0039368276 +-------- +main +0.0039063096 +aux +0.0038757916 diff -r 13d354e1184b -r c969b04fa0dc divergence/sqr-1kHz-2 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/divergence/sqr-1kHz-2 Mon Oct 31 00:14:46 2011 -0700 @@ -0,0 +1,77 @@ +creating new context via naddListener +-------- +main +0.0 +aux +0.0 +I'm playing! <3 +-------- +main +0.004791333 +aux +0.004791333 +-------- +main +0.004943923 +aux +0.004943923 +-------- +main +0.004943923 +aux +0.004943923 +-------- +main +0.004852369 +aux +0.004852369 +-------- +main +0.0046082246 +aux +0.0046082246 +-------- +main +0.0044861524 +aux +0.0044861524 +-------- +main +0.0044861524 +aux +0.0044861524 +-------- +main +0.004303044 +aux +0.004303044 +-------- +main +0.004242008 +aux +0.004180972 +-------- +main +0.004242008 +aux +0.004180972 +-------- +main +0.004150454 +aux +0.004119936 +-------- +main +0.0039673457 +aux +0.0039368276 +-------- +main +0.0039673457 +aux +0.0039368276 +-------- +main +0.0039063096 +aux +0.0038757916 diff -r 13d354e1184b -r c969b04fa0dc src/com/aurellem/capture/examples/AdvancedAudio.java --- a/src/com/aurellem/capture/examples/AdvancedAudio.java Sun Oct 30 14:58:01 2011 -0700 +++ b/src/com/aurellem/capture/examples/AdvancedAudio.java Mon Oct 31 00:14:46 2011 -0700 @@ -4,6 +4,8 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.nio.ByteBuffer; +import java.util.logging.Level; +import java.util.logging.Logger; import javax.sound.sampled.AudioFormat; @@ -59,7 +61,7 @@ public class AdvancedAudio extends SimpleApplication { public static void main(String[] args) { - + Logger.getLogger("com.jme3").setLevel(Level.OFF); AdvancedAudio app = new AdvancedAudio(); AppSettings settings = new AppSettings(true); settings.setAudioRenderer("Send"); @@ -205,14 +207,16 @@ music = new AudioNode(assetManager, "Sound/Environment/pure.wav", false); rootNode.attachChild(music); - audioRenderer.playSource(music); + //audioRenderer.playSource(music); music.setPositional(true); music.setVolume(1f); music.setReverbEnabled(false); music.setMaxDistance(200.0f); music.setRefDistance(1f); music.setRolloffFactor(5f); - audioRenderer.pauseSource(music); + + + //audioRenderer.pauseSource(music); } @@ -281,11 +285,12 @@ initAudio(); initKeys(); createScene(); + listener.setLocation(ear1.getLocalTranslation()); if (this.audioRenderer instanceof MultiListener){ MultiListener rf = (MultiListener)this.audioRenderer; - listener.setLocation(ear1.getLocalTranslation()); + auxListener = new Listener(listener); rf.addListener(auxListener); @@ -323,10 +328,10 @@ @Override public void onAction(String name, boolean keyPressed, float tpf) { if (name.equals("Shoot") && !keyPressed) { - System.out.println("I'm playing! <3"); - System.out.println(bell.getLocalTranslation().subtract(cam.getLocation()).length()); - bell.getMaterial().setColor("Color", ColorRGBA.randomColor()); - audioRenderer.playSource(music); + + System.out.println(bell.getLocalTranslation().subtract(listener.getLocation()).length()); + //bell.getMaterial().setColor("Color", ColorRGBA.randomColor()); + //audioRenderer.playSource(music); System.out.println(music.getRefDistance()); } @@ -336,31 +341,35 @@ /** Move the listener with the camera - for 3D audio. */ - private Vector3f prevBellPos = Vector3f.ZERO; - + //private Vector3f prevBellPos = Vector3f.ZERO; + private int countdown = 0; public void simpleUpdate(float tpf) { //Vector3f loc = cam.getLocation(); //Quaternion rot = cam.getRotation(); //listener.setLocation(loc); //listener.setRotation(rot); + System.out.println(countdown); + if (countdown++ == 14) { this.requestClose(false);} - + System.out.println("channel "+ music.getChannel()); //listener.setLocation(cam.getLocation()); //listener.setRotation(cam.getRotation()); //auxListener.setLocation(loc); //auxListener.setRotation(rot); if (music.getStatus() != AudioNode.Status.Playing){ - audioRenderer.playSource(music); + //audioRenderer.playSource(music); + music.play(); bell.getMaterial().setColor("Color", ColorRGBA.randomColor()); + System.out.println("I'm playing! <3"); } //audioRenderer.updateSourceParam(music, AudioParam.Direction); - Vector3f bellVelocity = bell.getLocalTranslation().subtract(prevBellPos).mult(1.0f/tpf); - prevBellPos = bell.getLocalTranslation(); + //Vector3f bellVelocity = bell.getLocalTranslation().subtract(prevBellPos).mult(1.0f/tpf); + //prevBellPos = bell.getLocalTranslation(); music.setLocalTranslation(bell.getLocalTranslation()); - music.setVelocity(bellVelocity); + //music.setVelocity(bellVelocity); //audioRenderer.updateSourceParam(music, AudioParam.Position); //audioRenderer.updateSourceParam(music, AudioParam.Velocity);