# HG changeset patch # User Robert McIntyre # Date 1322659956 25200 # Node ID 2f129118e2d6fc53fdd1ed71deb46d40cc286b2d # Parent b1bc965a38d2e8335ce7908c4abe68da469870ba removed old files and moved natives unpacking to the AudioRenderer diff -r b1bc965a38d2 -r 2f129118e2d6 build.xml --- a/build.xml Thu Nov 03 18:47:21 2011 -0700 +++ b/build.xml Wed Nov 30 06:32:36 2011 -0700 @@ -5,7 +5,7 @@ - + @@ -38,7 +38,6 @@ - diff -r b1bc965a38d2 -r 2f129118e2d6 divergence/pure --- a/divergence/pure Thu Nov 03 18:47:21 2011 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -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 b1bc965a38d2 -r 2f129118e2d6 divergence/pure-with-play --- a/divergence/pure-with-play Thu Nov 03 18:47:21 2011 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -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 b1bc965a38d2 -r 2f129118e2d6 divergence/pure2 --- a/divergence/pure2 Thu Nov 03 18:47:21 2011 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -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 b1bc965a38d2 -r 2f129118e2d6 divergence/results.txt --- a/divergence/results.txt Thu Nov 03 18:47:21 2011 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -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. - - -surprisingly, supporfEFX doesn't affect anything. - - -When things are off, they only appear to be off by one byte. main -will be at x and aux will be at x+1 or x-1. - -Setting audioNode paramaters changes the severity of the difference -but not its onset. - - -Non-positional sound has no problems. - - -Divergence gets worse the longer things run. - - -As the sound source moves about the listener in a circle, the sound -should be at a constant volume, since the distance between the source -and listener is constant. Instead, the sound varies depending on where -the thing is in the circle. Main cuts out at around 90degrees, while -aux cuts out at around 180 degrees. diff -r b1bc965a38d2 -r 2f129118e2d6 divergence/sqr-100Hz --- a/divergence/sqr-100Hz Thu Nov 03 18:47:21 2011 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,94 +0,0 @@ -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 b1bc965a38d2 -r 2f129118e2d6 divergence/sqr-1kHz-1 --- a/divergence/sqr-1kHz-1 Thu Nov 03 18:47:21 2011 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,77 +0,0 @@ -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 b1bc965a38d2 -r 2f129118e2d6 divergence/sqr-1kHz-2 --- a/divergence/sqr-1kHz-2 Thu Nov 03 18:47:21 2011 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,77 +0,0 @@ -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 b1bc965a38d2 -r 2f129118e2d6 divergence/with-supportEFX --- a/divergence/with-supportEFX Thu Nov 03 18:47:21 2011 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,129 +0,0 @@ -OPENAL-AURELLEM: alc_init_config!! -creating new context via naddListener --------- -main -0.0 -aux -0.0 -0 -channel -1 -I'm playing! <3 --------- -main -6.408789E-4 -aux -6.408789E-4 -1 -channel 0 --------- -main -0.0012512398 -aux -0.0012512398 -2 -channel 0 --------- -main -0.0018921187 -aux -0.0018921187 -3 -channel 0 --------- -main -0.0024719615 -aux -0.0024719615 -4 -channel 0 --------- -main -0.0030212863 -aux -0.0030212863 -5 -channel 0 --------- -main -0.003540093 -aux -0.003540093 -6 -channel 0 --------- -main -0.004089418 -aux -0.004089418 -7 -channel 0 --------- -main -0.0045471885 -aux -0.0045471885 -8 -channel 0 --------- -main -0.004943923 -aux -0.004913405 -inconsistency detected @ sample 16 -main : -60 -aux : -61 -9 -channel 0 --------- -main -0.004943923 -aux -0.004882887 -inconsistency detected @ sample 0 -main : -96 -aux : -97 -10 -channel 0 --------- -main -0.004791333 -aux -0.004760815 -inconsistency detected @ sample 0 -main : -59 -aux : -58 -11 -channel 0 --------- -main -0.0046082246 -aux -0.0045777066 -inconsistency detected @ sample 0 -main : -96 -aux : -95 -12 -channel 0 --------- -main -0.0046082246 -aux -0.0045777066 -inconsistency detected @ sample 0 -main : -107 -aux : -108 -13 -channel 0 --------- -main -0.0044556344 -aux -0.0044251163 -inconsistency detected @ sample 0 -main : -55 -aux : -54 -14 -channel 0 -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 b1bc965a38d2 -r 2f129118e2d6 divergence/without-supportEFX --- a/divergence/without-supportEFX Thu Nov 03 18:47:21 2011 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,129 +0,0 @@ -OPENAL-AURELLEM: alc_init_config!! -creating new context via naddListener --------- -main -0.0 -aux -0.0 -0 -channel -1 -I'm playing! <3 --------- -main -6.408789E-4 -aux -6.408789E-4 -1 -channel 0 --------- -main -0.0012512398 -aux -0.0012512398 -2 -channel 0 --------- -main -0.0018921187 -aux -0.0018921187 -3 -channel 0 --------- -main -0.0024719615 -aux -0.0024719615 -4 -channel 0 --------- -main -0.0030212863 -aux -0.0030212863 -5 -channel 0 --------- -main -0.003540093 -aux -0.003540093 -6 -channel 0 --------- -main -0.004089418 -aux -0.004089418 -7 -channel 0 --------- -main -0.0045471885 -aux -0.0045471885 -8 -channel 0 --------- -main -0.004943923 -aux -0.004913405 -inconsistency detected @ sample 16 -main : -60 -aux : -61 -9 -channel 0 --------- -main -0.004943923 -aux -0.004882887 -inconsistency detected @ sample 0 -main : -96 -aux : -97 -10 -channel 0 --------- -main -0.004791333 -aux -0.004760815 -inconsistency detected @ sample 0 -main : -59 -aux : -58 -11 -channel 0 --------- -main -0.0046082246 -aux -0.0045777066 -inconsistency detected @ sample 0 -main : -96 -aux : -95 -12 -channel 0 --------- -main -0.0046082246 -aux -0.0045777066 -inconsistency detected @ sample 0 -main : -107 -aux : -108 -13 -channel 0 --------- -main -0.0044556344 -aux -0.0044251163 -inconsistency detected @ sample 0 -main : -55 -aux : -54 -14 -channel 0 -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 b1bc965a38d2 -r 2f129118e2d6 src/com/aurellem/capture/audio/AudioSendRenderer.java --- a/src/com/aurellem/capture/audio/AudioSendRenderer.java Thu Nov 03 18:47:21 2011 -0700 +++ b/src/com/aurellem/capture/audio/AudioSendRenderer.java Wed Nov 30 06:32:36 2011 -0700 @@ -1,5 +1,6 @@ package com.aurellem.capture.audio; +import java.io.IOException; import java.lang.reflect.Field; import java.nio.ByteBuffer; import java.util.HashMap; @@ -20,6 +21,8 @@ import com.jme3.audio.Listener; import com.jme3.audio.lwjgl.LwjglAudioRenderer; import com.jme3.math.Vector3f; +import com.jme3.system.JmeSystem; +import com.jme3.system.Natives; import com.jme3.util.BufferUtils; public class AudioSendRenderer @@ -104,6 +107,25 @@ * instead to buffers which it makes available via JNI. */ public void initInThread(){ + + try{ + switch (JmeSystem.getPlatform()){ + case Windows64: + Natives.extractNativeLib("windows/audioSend", "OpenAL64", true, true); + break; + case Windows32: + Natives.extractNativeLib("windows/audioSend", "OpenAL32", true, true); + break; + case Linux64: + Natives.extractNativeLib("linux/audioSend", "openal64", true, true); + break; + case Linux32: + Natives.extractNativeLib("linux/audioSend", "openal", true, true); + break; + } + } + catch (IOException ex) {ex.printStackTrace();} + try{ if (!AL.isCreated()){ AL.create("Multiple Audio Send", 44100, 60, false); diff -r b1bc965a38d2 -r 2f129118e2d6 src/com/aurellem/capture/examples/Advanced.java --- a/src/com/aurellem/capture/examples/Advanced.java Thu Nov 03 18:47:21 2011 -0700 +++ b/src/com/aurellem/capture/examples/Advanced.java Wed Nov 30 06:32:36 2011 -0700 @@ -34,6 +34,7 @@ import com.jme3.scene.shape.Box; import com.jme3.scene.shape.Sphere; import com.jme3.system.AppSettings; +import com.jme3.system.Natives; /** @@ -73,12 +74,25 @@ app.setSettings(settings); app.setShowSettings(false); app.setPauseOnLostFocus(false); - + + + try { Capture.captureVideo(app, File.createTempFile("advanced",".avi")); Capture.captureAudio(app, File.createTempFile("advanced", ".wav")); } catch (IOException e) {e.printStackTrace();} + + app.start(); + } + + public static void test(){ + Advanced app = new Advanced(); + AppSettings settings = new AppSettings(true); + settings.setAudioRenderer("Send"); + app.setSettings(settings); + app.setShowSettings(false); + app.setPauseOnLostFocus(false); app.start(); } diff -r b1bc965a38d2 -r 2f129118e2d6 transcoding.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/transcoding.txt Wed Nov 30 06:32:36 2011 -0700 @@ -0,0 +1,12 @@ +ffmpeg -r 60 -b 5000k -i out/%07d.png out.ogg + + + +# this is wrong. Why is is wrong!@ +# ffmpeg -i main.wav -acodec libvorbis -i out.ogg -vcodec copy final.ogg + + +# it's wrong because the inputs need to come first? +ffmpeg -i main.wav -i out.ogg -sameq -acodec libvorbis -vcodec copy final.ogg +# apparently +