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
@@ -53,6 +53,7 @@ export interface ForestElement {
export interface Settings {
id: 1; // singleton
audioEnabled: boolean;
speechEnabled: boolean;
apiKey: string;
apiCallsToday: { text: number; image: number };
lastApiCallDate: string; // ISO date "YYYY-MM-DD"