diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index 6b20903..994bc6e 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -37,7 +37,7 @@ jobs: coverage: none - name: Cache Composer dependencies - uses: actions/cache@v4 + uses: actions/cache@v6 with: path: vendor key: ${{ runner.os }}-composer-no-dev-${{ hashFiles('composer.lock') }} @@ -48,7 +48,7 @@ jobs: run: composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader - name: Cache npm dependencies - uses: actions/cache@v4 + uses: actions/cache@v6 with: path: node_modules key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }} diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index b9f8d96..1b27875 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -22,7 +22,7 @@ jobs: run: composer update nbucic/audio-tts --no-install --no-interaction --quiet --no-scripts - name: Cache Composer dependencies - uses: actions/cache@v4 + uses: actions/cache@v6 with: path: vendor key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }} diff --git a/app/Livewire/Settings.php b/app/Livewire/Settings.php index 8d04d4e..738aa09 100644 --- a/app/Livewire/Settings.php +++ b/app/Livewire/Settings.php @@ -22,7 +22,7 @@ class Settings extends Component public string $soundMode = 'beep'; - public float $volume = 0.8; + public float $volume = 1.0; public bool $keepScreenOn = true; diff --git a/app/Models/Setting.php b/app/Models/Setting.php index 150f541..bc001fb 100644 --- a/app/Models/Setting.php +++ b/app/Models/Setting.php @@ -34,7 +34,7 @@ public static function current(): self 'default_beep_lead_in' => BeepLeadIn::Three, 'default_end_sound' => 'triple', 'sound_mode' => 'beep', - 'volume' => 0.8, + 'volume' => 1.0, 'keep_screen_on' => true, ]); } diff --git a/packages/nbucic/audio-tts/resources/android/AudioTTSFunctions.kt b/packages/nbucic/audio-tts/resources/android/AudioTTSFunctions.kt index 6efbb22..98d15cc 100644 --- a/packages/nbucic/audio-tts/resources/android/AudioTTSFunctions.kt +++ b/packages/nbucic/audio-tts/resources/android/AudioTTSFunctions.kt @@ -67,7 +67,7 @@ private object TTSEngine { val utteranceId = text.hashCode().toString() val params = Bundle().apply { - putInt(TextToSpeech.Engine.KEY_PARAM_STREAM, AudioManager.STREAM_MUSIC) + putInt(TextToSpeech.Engine.KEY_PARAM_STREAM, AudioManager.STREAM_ALARM) putFloat(TextToSpeech.Engine.KEY_PARAM_VOLUME, volume.coerceIn(0f, 1f)) } diff --git a/resources/js/app.js b/resources/js/app.js index 35c2c85..cfa5d9a 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -8,7 +8,7 @@ document.addEventListener('alpine:init', () => { timer: null, audio: null, soundMode: 'beep', - volume: 0.8, + volume: 1.0, keepScreenOn: true, interval: null, _wakeLock: null, @@ -42,11 +42,11 @@ document.addEventListener('alpine:init', () => { if (this.soundMode === 'voice') { const text = this.voiceText(reason); console.log('[TTS] playBeep: reason=' + reason + ', voiceText="' + text + '"'); - await audioTTS.speak(text); + await audioTTS.speak(text, this.volume); } else if (reason === 'prepare') { - this.audio.prepareBeep(); - } else { this.audio.beep(); + } else { + this.audio.prepareBeep(); } }); @@ -113,7 +113,7 @@ document.addEventListener('alpine:init', () => { })); Alpine.data('settingsSounds', () => ({ soundMode: 'beep', - volume: 0.8, + volume: 1.0, init() { this.soundMode = this.$wire.soundMode; diff --git a/resources/js/audio.js b/resources/js/audio.js index 67ef860..eca405e 100644 --- a/resources/js/audio.js +++ b/resources/js/audio.js @@ -1,7 +1,7 @@ /** * Audio engine for the interval timer. */ -export function initAudio(volume = 0.8) { +export function initAudio(volume = 1.0) { volume = Math.max(0, Math.min(1, volume)); let ctx = null; @@ -25,7 +25,7 @@ export function initAudio(volume = 0.8) { osc.type = 'sine'; osc.frequency.setValueAtTime(freq, start); - gain.gain.setValueAtTime(volume * 0.6, start); + gain.gain.setValueAtTime(volume, start); gain.gain.exponentialRampToValueAtTime(0.001, end); osc.connect(gain);