diff --git a/Assets/_PROJECT/Fonts/Handlee-Regular SDF.asset b/Assets/_PROJECT/Fonts/Handlee-Regular SDF.asset index 0df3a826..85d6a6a1 100644 --- a/Assets/_PROJECT/Fonts/Handlee-Regular SDF.asset +++ b/Assets/_PROJECT/Fonts/Handlee-Regular SDF.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cc9c3b7d052c482436aac284ef0084b72fc0533e7804cffbc7618c914f51faea -size 2777316 +oid sha256:3ee2ff7dd8e3d8fa20583d79090b1355d72ee2e229ca418af353a8cfef176113 +size 2784462 diff --git a/Assets/_PROJECT/Fonts/Quantico-Regular SDF.asset b/Assets/_PROJECT/Fonts/Quantico-Regular SDF.asset index 8818d6d1..d56f62f3 100644 --- a/Assets/_PROJECT/Fonts/Quantico-Regular SDF.asset +++ b/Assets/_PROJECT/Fonts/Quantico-Regular SDF.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:76a3132e2762baf62cd12bcc279c1f221f76fcd192d6f12c495aa1e734058050 -size 2145268 +oid sha256:4d703acbc29d2da0d3cf84f2b5e1cb15aca174f7120b094c806b790cc737e231 +size 2145089 diff --git a/Assets/_PROJECT/Scripts/ModeGeneration/FMODWhisperBridge.cs b/Assets/_PROJECT/Scripts/ModeGeneration/FMODWhisperBridge.cs index e0d2ecaf..a4b560da 100644 --- a/Assets/_PROJECT/Scripts/ModeGeneration/FMODWhisperBridge.cs +++ b/Assets/_PROJECT/Scripts/ModeGeneration/FMODWhisperBridge.cs @@ -4,9 +4,9 @@ using System.Runtime.InteropServices; using UnityEngine; using FMOD; using FMODUnity; -using Whisper; // WhisperManager, WhisperStream, WhisperResult +using Whisper; using Whisper.Utils; -using Debug = UnityEngine.Debug; // AudioChunk +using Debug = UnityEngine.Debug; /// /// FMOD mic is initialized once (Start) and runs continuously in a ring buffer. @@ -28,12 +28,6 @@ public class FMODWhisperBridge : MonoBehaviour public int channels = 1; [Range(1, 10)] public int bufferLengthSec = 5; - [Header("Loopback (monitor your voice)")] - public bool playLoopback = true; - [Tooltip("If true, loopback plays only while active; otherwise it’s always on.")] - public bool loopbackOnlyWhenActive = true; - [Range(0f, 2f)] public float loopbackVolume = 1.0f; - public delegate void OnWhisperSegmentUpdatedDelegate(string result); public event OnWhisperSegmentUpdatedDelegate OnWhisperSegmentUpdated; @@ -44,7 +38,6 @@ public class FMODWhisperBridge : MonoBehaviour private FMOD.System _core; private Sound _recSound; private Channel _playChannel; - private ChannelGroup _masterGroup; private uint _soundPcmLength; // in samples private int _nativeRate; private int _nativeChannels; @@ -138,24 +131,6 @@ public class FMODWhisperBridge : MonoBehaviour _core.getRecordPosition(recordDriverId, out _lastRecordPos); Debug.Log("[FMOD→Whisper] Recording started."); - // Loopback channel (optional). Start once; pause when inactive if desired. - _core.getMasterChannelGroup(out _masterGroup); - if (playLoopback) - { - res = _core.playSound(_recSound, _masterGroup, false, out _playChannel); - if (res == RESULT.OK && _playChannel.hasHandle()) - { - _playChannel.setMode(MODE._2D); - _playChannel.setVolume(loopbackVolume); - if (loopbackOnlyWhenActive) _playChannel.setPaused(true); // keep muted until Activate - Debug.Log("[FMOD→Whisper] Loopback playback ready."); - } - else - { - Debug.LogWarning($"[FMOD→Whisper] playSound failed or channel invalid: {res}"); - } - } - // No Whisper stream here. It will be created on ActivateRecording(). await System.Threading.Tasks.Task.Yield(); } @@ -217,11 +192,6 @@ public class FMODWhisperBridge : MonoBehaviour _streamStarted = true; - // --- NEW: Clear the ring buffer and reset read pointer --- - // Pause loopback while we clear (optional, but avoids clicks) - if (playLoopback && _playChannel.hasHandle()) - _playChannel.setPaused(true); - // Clear buffer bytes ClearRecordRingBuffer(); @@ -231,13 +201,8 @@ public class FMODWhisperBridge : MonoBehaviour // We’ll skip feeding for one frame to guarantee a clean start _skipOneFeedFrame = true; - // Unpause loopback if we want it active during recording - if (playLoopback && _playChannel.hasHandle() && (!loopbackOnlyWhenActive || isRecordingActivated)) - _playChannel.setPaused(loopbackOnlyWhenActive ? false : _playChannel.getPaused(out var paused) == FMOD.RESULT.OK && paused ? false : false); - isRecordingActivated = true; Debug.Log("[FMOD→Whisper] Stream activated (buffer cleared; reading from current head)."); - } /// @@ -249,10 +214,6 @@ public class FMODWhisperBridge : MonoBehaviour return; isRecordingActivated = false; - - // Pause loopback if it should only be active during recording - if (playLoopback && loopbackOnlyWhenActive && _playChannel.hasHandle()) - _playChannel.setPaused(true); } /// @@ -277,7 +238,6 @@ public class FMODWhisperBridge : MonoBehaviour return Mathf.Clamp01(Mathf.InverseLerp(-60f, -15f, db)); } - private void Update() { // Always tick FMOD @@ -285,8 +245,7 @@ public class FMODWhisperBridge : MonoBehaviour if (!_recSound.hasHandle()) return; // Compute how many samples recorded since last frame. - uint recPos; - _core.getRecordPosition(recordDriverId, out recPos); + _core.getRecordPosition(recordDriverId, out uint recPos); uint deltaSamples = (recPos >= _lastRecordPos) ? (recPos - _lastRecordPos) @@ -353,7 +312,6 @@ public class FMODWhisperBridge : MonoBehaviour } } - // If skipping, we just discard this frame to ensure no stale data leaks. } finally @@ -364,7 +322,6 @@ public class FMODWhisperBridge : MonoBehaviour if (_skipOneFeedFrame) _skipOneFeedFrame = false; _lastRecordPos = recPos; - } private string PostProcessInput(string input) diff --git a/config.json b/config.json index ae9c0246..4ec541c5 100644 --- a/config.json +++ b/config.json @@ -1,7 +1,7 @@ { "isContinuousLocomotion": true, "continuousLocomotionSpeed": 3.0, - "volumeMaster": 0.6466318964958191, + "volumeMaster": 0.5095056295394898, "volumeAmbient": 0.1889490932226181, "volumeMusic": 0.5, "volumeSFX": 0.5, diff --git a/highscore.json b/highscore.json index ecb9d789..317b769e 100644 --- a/highscore.json +++ b/highscore.json @@ -1 +1 @@ -{"HighScore":1.0} \ No newline at end of file +{"HighScore":212.0} \ No newline at end of file diff --git a/highscores.json b/highscores.json index 3b024257..b0721532 100644 --- a/highscores.json +++ b/highscores.json @@ -4,6 +4,10 @@ "name": "karlkolm", "score": 241.0 }, + { + "name": "jass", + "score": 212.0 + }, { "name": "andreas", "score": 207.0 @@ -20,6 +24,10 @@ "name": "jjkujkkg", "score": 194.0 }, + { + "name": "kuues", + "score": 186.0 + }, { "name": "gert", "score": 184.0 @@ -32,6 +40,10 @@ "name": "f", "score": 181.0 }, + { + "name": "kosta", + "score": 180.0 + }, { "name": "gg", "score": 179.0 @@ -47,14 +59,6 @@ { "name": "hendrik", "score": 163.0 - }, - { - "name": "andeas", - "score": 161.0 - }, - { - "name": "fark..........", - "score": 142.0 } ] } \ No newline at end of file