diff semiconginev2/audio/mixer.nim @ 1234:841e12f33c47

add: text & font rendering, not tested yet
author sam <sam@basx.dev>
date Sat, 20 Jul 2024 00:03:57 +0700
parents a3fa15c25026
children
line wrap: on
line diff
--- a/semiconginev2/audio/mixer.nim	Fri Jul 19 21:25:42 2024 +0700
+++ b/semiconginev2/audio/mixer.nim	Sat Jul 20 00:03:57 2024 +0700
@@ -1,4 +1,3 @@
-
 const NBUFFERS = 32
 const BUFFERSAMPLECOUNT = 256
 const AUDIO_SAMPLE_RATE* = 44100
@@ -199,10 +198,6 @@
 proc updateSoundBuffer(mixer: var Mixer) =
   let t = getMonoTime()
 
-  let tDebug = getTime()
-  # echo ""
-  # echo tDebug
-
   let dt = (t - mixer.lastUpdate).inNanoseconds.float64 / 1_000_000_000'f64
   mixer.lastUpdate = t
 
@@ -238,9 +233,7 @@
           track.playing.del(id)
       mixer.buffers[mixer.currentBuffer][i] = mixedSample
   # send data to sound device
-  # echo getTime() - tDebug
   mixer.device.WriteSoundData(mixer.currentBuffer)
-  # echo getTime() - tDebug
   mixer.currentBuffer = (mixer.currentBuffer + 1) mod mixer.buffers.len
 
 # DSP functions