Ver código fonte

allow to customize CHANNEL_BUFSIZE

ncannasse 8 anos atrás
pai
commit
fca0cd2e9c
1 arquivos alterados com 3 adições e 1 exclusões
  1. 3 1
      hxd/snd/ALEmulator.hx

+ 3 - 1
hxd/snd/ALEmulator.hx

@@ -82,6 +82,8 @@ class ALSource {
 	// This seems related to some lag in NativeChannel creation and data delivery
 	static inline var STOP_DELAY = #if js 200 #else 0 #end;
 
+	public static var CHANNEL_BUFSIZE = 4096; /* 100 ms latency @44.1Khz */
+
 	static var ID = 0;
 	static var all = new Map<Int,ALSource>();
 
@@ -114,7 +116,7 @@ class ALSource {
 	public function play() {
 		if( chan == null ) {
 			playedTime = haxe.Timer.stamp() - currentSample / frequency;
-			chan = new ALChannel(this, 4096 /* 100 ms latency @44.1Khz */);
+			chan = new ALChannel(this, CHANNEL_BUFSIZE);
 		}
 	}