Initial commit
This commit is contained in:
12
.claude-plugin/plugin.json
Normal file
12
.claude-plugin/plugin.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"name": "leapmultix-skill-sound-effect-manager",
|
||||||
|
"description": "Skill sound-effect-manager from LeapMultix",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"author": {
|
||||||
|
"name": "Julien LE SAUX",
|
||||||
|
"email": "contact@jls42.org"
|
||||||
|
},
|
||||||
|
"skills": [
|
||||||
|
"./skills"
|
||||||
|
]
|
||||||
|
}
|
||||||
3
README.md
Normal file
3
README.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# leapmultix-skill-sound-effect-manager
|
||||||
|
|
||||||
|
Skill sound-effect-manager from LeapMultix
|
||||||
45
plugin.lock.json
Normal file
45
plugin.lock.json
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
{
|
||||||
|
"$schema": "internal://schemas/plugin.lock.v1.json",
|
||||||
|
"pluginId": "gh:jls42/leapmultix:leapmultix-marketplace/skills/sound-effect-manager",
|
||||||
|
"normalized": {
|
||||||
|
"repo": null,
|
||||||
|
"ref": "refs/tags/v20251128.0",
|
||||||
|
"commit": "f41a150585b70edd36fd16893f0ec118757795c4",
|
||||||
|
"treeHash": "d1556436629ebda40bd42b3a720137f6b286cc9a5f805f73ea129a09b5cc4db0",
|
||||||
|
"generatedAt": "2025-11-28T10:19:14.750322Z",
|
||||||
|
"toolVersion": "publish_plugins.py@0.2.0"
|
||||||
|
},
|
||||||
|
"origin": {
|
||||||
|
"remote": "git@github.com:zhongweili/42plugin-data.git",
|
||||||
|
"branch": "master",
|
||||||
|
"commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390",
|
||||||
|
"repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data"
|
||||||
|
},
|
||||||
|
"manifest": {
|
||||||
|
"name": "leapmultix-skill-sound-effect-manager",
|
||||||
|
"description": "Skill sound-effect-manager from LeapMultix",
|
||||||
|
"version": "1.0.0"
|
||||||
|
},
|
||||||
|
"content": {
|
||||||
|
"files": [
|
||||||
|
{
|
||||||
|
"path": "README.md",
|
||||||
|
"sha256": "142367528694206a2f54e4e6f0d9cbb6d89bac20e61ba7b390924c5f2633371f"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".claude-plugin/plugin.json",
|
||||||
|
"sha256": "b2f6969be93a393e7f32627540e34b20b148c75d0717095adbcb105f17977c7c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "skills/sound-effect-manager/SKILL.md",
|
||||||
|
"sha256": "486f12dd2145bca5abc5f7fcd9e6b5620f3907228ab46f833026c032b902cc80"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"dirSha256": "d1556436629ebda40bd42b3a720137f6b286cc9a5f805f73ea129a09b5cc4db0"
|
||||||
|
},
|
||||||
|
"security": {
|
||||||
|
"scannedAt": null,
|
||||||
|
"scannerVersion": null,
|
||||||
|
"flags": []
|
||||||
|
}
|
||||||
|
}
|
||||||
87
skills/sound-effect-manager/SKILL.md
Normal file
87
skills/sound-effect-manager/SKILL.md
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
---
|
||||||
|
name: managing-sound-effects
|
||||||
|
description: Manages sound effects and audio for user feedback (correct/wrong sounds, music, volume). Use when adding new sounds or managing audio
|
||||||
|
allowed-tools: Read, Write, Grep, Glob, Bash
|
||||||
|
---
|
||||||
|
|
||||||
|
# Sound Effect Manager
|
||||||
|
|
||||||
|
Gère effets sonores et feedback audio pour meilleure expérience utilisateur.
|
||||||
|
|
||||||
|
## Quand utiliser
|
||||||
|
|
||||||
|
- Ajout de nouveaux effets sonores
|
||||||
|
- Gestion du volume et mute
|
||||||
|
- Musique de fond pour jeux
|
||||||
|
- Feedback audio utilisateur
|
||||||
|
- Optimisation chargement audio
|
||||||
|
|
||||||
|
## AudioManager (js/core/audio.js)
|
||||||
|
|
||||||
|
**API :**
|
||||||
|
|
||||||
|
- `playSound(soundName, options)` - Jouer son
|
||||||
|
- `setVolume(volume)` - Volume global (0.0-1.0)
|
||||||
|
- `toggleMute()` / `isMuted()` - Mute control
|
||||||
|
|
||||||
|
**Sons disponibles (examine audio.js) :**
|
||||||
|
correct, wrong, victory, click, coin, levelup
|
||||||
|
|
||||||
|
## Ajouter un nouveau son
|
||||||
|
|
||||||
|
1. **Compresser :** < 50 KB (96 kbps pour effets, 128 kbps musique)
|
||||||
|
2. **Formats :** MP3, OGG, WebM (fallback)
|
||||||
|
3. **Placer :** assets/sounds/
|
||||||
|
4. **Enregistrer :** SOUND_CATALOG dans audio.js
|
||||||
|
5. **Utiliser :**
|
||||||
|
```javascript
|
||||||
|
import { playSound } from './core/audio.js';
|
||||||
|
playSound('yourSound');
|
||||||
|
```
|
||||||
|
|
||||||
|
## Patterns essentiels
|
||||||
|
|
||||||
|
- **Préchargement :** Sons critiques avant utilisation
|
||||||
|
- **Pool audio :** Instances multiples pour chevauchement
|
||||||
|
- **Musique fond :** Volume 0.3, loop activé, cleanup dans destroy
|
||||||
|
- **Mobile :** Autoplay nécessite interaction utilisateur
|
||||||
|
- **Accessibilité :** Respecter prefers-reduced-motion
|
||||||
|
|
||||||
|
## Gestion du lifecycle
|
||||||
|
|
||||||
|
**Mode avec musique :**
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// Lancer musique
|
||||||
|
playSound('background-music', { loop: true, volume: 0.3 });
|
||||||
|
|
||||||
|
// cleanup() → stopper musique
|
||||||
|
```
|
||||||
|
|
||||||
|
Examine QuizMode/ChallengeMode pour patterns existants.
|
||||||
|
|
||||||
|
## Checklist ajout son
|
||||||
|
|
||||||
|
- [ ] Fichier compressé < 50 KB
|
||||||
|
- [ ] Formats multiples (MP3, OGG, WebM)
|
||||||
|
- [ ] Ajouté au SOUND_CATALOG
|
||||||
|
- [ ] Volume testé
|
||||||
|
- [ ] Mute fonctionne
|
||||||
|
- [ ] Cleanup musique si loop
|
||||||
|
- [ ] Mobile autoplay OK
|
||||||
|
|
||||||
|
## En cas de doute
|
||||||
|
|
||||||
|
**Règles absolues :**
|
||||||
|
|
||||||
|
1. Utiliser audio.js API (jamais créer Audio directement)
|
||||||
|
2. < 50 KB par fichier
|
||||||
|
3. Stopper musique dans cleanup()
|
||||||
|
4. Pas d'autoplay sans interaction utilisateur
|
||||||
|
5. Volume par défaut ≤ 0.7
|
||||||
|
|
||||||
|
**Référence :**
|
||||||
|
|
||||||
|
- `js/core/audio.js` - API complète
|
||||||
|
- `assets/sounds/` - Catalogues existants
|
||||||
|
- Modes (QuizMode, ChallengeMode) - Exemples d'utilisation
|
||||||
Reference in New Issue
Block a user