feat(04-01): add audio/speech modules and speechEnabled to Settings

- Create src/audio/sounds.ts with playCorrectSound, playRewardSound, playForestElementSound
- Create src/audio/speech.ts with speakText via Web Speech API
- Add speechEnabled field to Settings interface in types.ts
- Add speechEnabled defaults in all Settings initializers (gemini.ts, parent.ts, db.test.ts)
- All sound functions check audioEnabled, speakText checks speechEnabled
- AudioContext lazy initialization for autoplay policy compliance
This commit is contained in:
2026-03-29 18:16:53 +02:00
parent 7931f7ec39
commit c19b7fedc1
5 changed files with 207 additions and 0 deletions
+1
View File
@@ -125,6 +125,7 @@ function getDefaultSettings(): Settings {
return {
id: 1,
audioEnabled: true,
speechEnabled: false,
apiKey: "",
apiCallsToday: { text: 0, image: 0 },
lastApiCallDate: getTodayDate(),