@umituz/react-native-ai-generation-content 1.17.232 → 1.17.233

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/README.md +236 -261
  2. package/package.json +1 -1
  3. package/src/domains/content-moderation/README.md +239 -296
  4. package/src/domains/creations/README.md +242 -325
  5. package/src/domains/face-detection/README.md +228 -307
  6. package/src/domains/prompts/README.md +242 -312
  7. package/src/features/ai-hug/README.md +381 -219
  8. package/src/features/ai-kiss/README.md +388 -219
  9. package/src/features/anime-selfie/README.md +327 -256
  10. package/src/features/audio-generation/README.md +352 -309
  11. package/src/features/colorization/README.md +332 -228
  12. package/src/features/couple-future/README.md +387 -212
  13. package/src/features/future-prediction/README.md +391 -221
  14. package/src/features/hd-touch-up/README.md +339 -252
  15. package/src/features/image-captioning/README.md +359 -299
  16. package/src/features/image-to-image/README.md +398 -357
  17. package/src/features/image-to-video/README.md +337 -292
  18. package/src/features/inpainting/README.md +348 -244
  19. package/src/features/meme-generator/README.md +350 -269
  20. package/src/features/remove-background/README.md +335 -234
  21. package/src/features/remove-object/README.md +341 -288
  22. package/src/features/replace-background/README.md +353 -236
  23. package/src/features/script-generator/README.md +358 -287
  24. package/src/features/shared/README.md +254 -223
  25. package/src/features/sketch-to-image/README.md +331 -234
  26. package/src/features/style-transfer/README.md +336 -237
  27. package/src/features/text-to-video/README.md +360 -193
  28. package/src/features/text-to-voice/README.md +382 -272
@@ -1,335 +1,445 @@
1
- # Text to Voice
1
+ # Text to Voice Feature
2
2
 
3
3
  Convert text to natural-sounding speech using AI.
4
4
 
5
- ## Features
5
+ ## 📍 Import Path
6
6
 
7
- - Convert text to lifelike speech
8
- - Multiple voice options and languages
9
- - Adjustable speed and pitch
10
- - Support for long-form text
11
- - Natural intonation and expression
7
+ ```typescript
8
+ import { useTextToVoiceFeature } from '@umituz/react-native-ai-generation-content';
9
+ ```
12
10
 
13
- ## Installation
11
+ **Location**: `src/features/text-to-voice/`
14
12
 
15
- This feature is part of `@umituz/react-native-ai-generation-content`.
13
+ ## 🎯 Feature Purpose
16
14
 
17
- ```bash
18
- npm install @umituz/react-native-ai-generation-content
19
- ```
15
+ Convert written text into lifelike speech using AI-powered text-to-speech technology. Support for multiple voices, languages, adjustable speed and pitch, with natural intonation and expression for audiobooks, accessibility, voice assistants, and more.
20
16
 
21
- ## Basic Usage
17
+ ---
22
18
 
23
- ### Using the Hook
19
+ ## 📋 Usage Strategy
24
20
 
25
- ```tsx
26
- import { useTextToVoiceFeature } from '@umituz/react-native-ai-generation-content';
21
+ ### When to Use This Feature
27
22
 
28
- function TextToVoiceScreen() {
29
- const feature = useTextToVoiceFeature({
30
- config: {
31
- model: 'chirp-3',
32
- onTextChange: (text) => console.log('Text changed:', text),
33
- onProcessingStart: () => console.log('Starting generation...'),
34
- onProcessingComplete: (result) => console.log('Complete:', result),
35
- onError: (error) => console.error('Error:', error),
36
- },
37
- userId: 'user-123',
38
- });
39
-
40
- const [sound, setSound] = useState<Sound | null>(null);
41
-
42
- const playAudio = async () => {
43
- if (feature.state.audioUrl) {
44
- const { sound } = await Audio.Sound.createAsync(
45
- { uri: feature.state.audioUrl },
46
- { shouldPlay: true }
47
- );
48
- setSound(sound);
49
- }
50
- };
51
-
52
- return (
53
- <View>
54
- <TextInput
55
- placeholder="Enter text to convert to speech..."
56
- onChangeText={feature.setText}
57
- value={feature.state.text}
58
- multiline
59
- numberOfLines={4}
60
- />
61
-
62
- <VoiceSelector
63
- selectedVoice={feature.state.voice}
64
- onSelectVoice={feature.setVoice}
65
- />
66
-
67
- <Button
68
- title="Generate Speech"
69
- onPress={() => feature.generate()}
70
- disabled={!feature.isReady}
71
- />
72
-
73
- {feature.state.isProcessing && (
74
- <ActivityIndicator />
75
- )}
76
-
77
- {feature.state.audioUrl && (
78
- <View>
79
- <Button title="Play Audio" onPress={playAudio} />
80
- <Button title="Save Audio" onPress={() => feature.saveAudio()} />
81
- </View>
82
- )}
83
- </View>
84
- );
85
- }
86
- ```
23
+ **Use Cases:**
24
+ - Creating audiobooks and narration
25
+ - Building voice assistants
26
+ - Accessibility features for visually impaired
27
+ - Voiceovers for videos and presentations
28
+ - Podcast and content creation
87
29
 
88
- ### Using the Unified AI Feature Screen
30
+ **When NOT to Use:**
31
+ - Generating audio from descriptions (use Audio Generation)
32
+ - Real-time translation (use translation services)
33
+ - Voice cloning or impersonation
34
+ - Music generation
89
35
 
90
- ```tsx
91
- import { AIFeatureScreen } from '@umituz/react-native-ai-generation-content';
36
+ ### Implementation Strategy
92
37
 
93
- function App() {
94
- return (
95
- <AIFeatureScreen
96
- featureId="text-to-voice"
97
- userId="user-123"
98
- />
99
- );
100
- }
101
- ```
38
+ 1. **Enter text** to convert to speech
39
+ 2. **Select voice** from available options
40
+ 3. **Adjust settings** (speed, pitch)
41
+ 4. **Generate speech** with progress tracking
42
+ 5. **Preview audio** with playback controls
43
+ 6. **Save or share** final audio file
102
44
 
103
- ## Configuration Options
45
+ ---
104
46
 
105
- ### Feature Config
47
+ ## ⚠️ Critical Rules (MUST FOLLOW)
106
48
 
107
- ```tsx
108
- interface TextToVoiceFeatureConfig {
109
- model?: string; // AI model to use (default: 'chirp-3')
110
- defaultVoice?: string; // Default voice ID
111
- defaultSpeed?: number; // Speech speed (0.25 - 4.0, default: 1.0)
112
- defaultPitch?: number; // Pitch adjustment (-20.0 - 20.0, default: 0)
113
- onTextChange?: (text: string) => void;
114
- onProcessingStart?: () => void;
115
- onProcessingComplete?: (result: TextToVoiceResult) => void;
116
- onError?: (error: string) => void;
117
- }
118
- ```
49
+ ### 1. Input Requirements
50
+ - **MUST** provide text to convert
51
+ - **MUST** select valid voice
52
+ - **MUST** keep text under character limits (5000 chars recommended)
53
+ - **MUST NOT** use copyrighted material without permission
54
+ - **MUST NOT** generate offensive or harmful content
119
55
 
120
- ### Generation Options
56
+ ### 2. Configuration
57
+ - **MUST** provide valid `userId` for tracking
58
+ - **MUST** specify voice selection
59
+ - **MUST** implement `onError` callback
60
+ - **MUST** implement audio playback controls
61
+ - **MUST** handle file saving locally
121
62
 
122
- ```tsx
123
- interface TextToVoiceOptions {
124
- voice: string; // Voice ID
125
- speed?: number; // Speech rate (0.25 - 4.0)
126
- pitch?: number; // Pitch adjustment (-20.0 - 20.0)
127
- language?: string; // Language code (e.g., 'en-US', 'es-ES')
128
- }
129
- ```
63
+ ### 3. State Management
64
+ - **MUST** check `isReady` before enabling generate button
65
+ - **MUST** validate text and voice before generation
66
+ - **MUST** handle `isProcessing` state to prevent duplicate requests
67
+ - **MUST** display `error` state with clear messages
68
+ - **MUST** implement proper cleanup on unmount (dispose audio)
130
69
 
131
- ## Available Voices
70
+ ### 4. Performance
71
+ - **MUST** implement progress indicators during generation
72
+ - **MUST** cache generated audio locally
73
+ - **MUST** allow users to cancel long generations
74
+ - **MUST** implement proper audio file disposal
75
+ - **MUST NOT** generate multiple audio files simultaneously
132
76
 
133
- ### English Voices
77
+ ### 5. Audio Quality
78
+ - **MUST** provide audio preview with playback controls
79
+ - **MUST** support common audio formats (MP3, WAV)
80
+ - **MUST** handle large audio file sizes
81
+ - **MUST** implement play/pause/stop controls
82
+ - **MUST** offer regeneration with different settings
134
83
 
135
- ```tsx
136
- const englishVoices = [
137
- { id: 'en-US-Neural2-A', name: 'Female (American)', gender: 'female' },
138
- { id: 'en-US-Neural2-B', name: 'Male (American)', gender: 'male' },
139
- { id: 'en-GB-Neural2-A', name: 'Female (British)', gender: 'female' },
140
- { id: 'en-GB-Neural2-B', name: 'Male (British)', gender: 'male' },
141
- ];
142
- ```
84
+ ---
143
85
 
144
- ### Multi-Language Voices
145
-
146
- ```tsx
147
- const voices = [
148
- { id: 'es-ES-Neural2-A', name: 'Spanish (Female)', language: 'es-ES' },
149
- { id: 'fr-FR-Neural2-A', name: 'French (Female)', language: 'fr-FR' },
150
- { id: 'de-DE-Neural2-A', name: 'German (Female)', language: 'de-DE' },
151
- { id: 'it-IT-Neural2-A', name: 'Italian (Female)', language: 'it-IT' },
152
- { id: 'ja-JP-Neural2-A', name: 'Japanese (Female)', language: 'ja-JP' },
153
- { id: 'ko-KR-Neural2-A', name: 'Korean (Female)', language: 'ko-KR' },
154
- { id: 'zh-CN-Neural2-A', name: 'Chinese (Female)', language: 'zh-CN' },
155
- ];
156
- ```
86
+ ## 🚫 Prohibitions (MUST AVOID)
157
87
 
158
- ## Component Examples
88
+ ### Strictly Forbidden
159
89
 
160
- ### Voice Selector
90
+ **NEVER** do the following:
161
91
 
162
- ```tsx
163
- import { GridSelector } from '@umituz/react-native-ai-generation-content';
92
+ 1. **No Empty Text**
93
+ - Always validate text is provided
94
+ - Never call generate() without text
95
+ - Guide users with example texts
164
96
 
165
- const voices = [
166
- { id: 'voice-1', name: 'Sarah', description: 'American English (Female)' },
167
- { id: 'voice-2', name: 'John', description: 'American English (Male)' },
168
- { id: 'voice-3', name: 'Emma', description: 'British English (Female)' },
169
- ];
97
+ 2. **No Auto-Generation**
98
+ - Never start generation without user action
99
+ - Always require explicit "Generate" button press
100
+ - Show preview before processing
170
101
 
171
- <GridSelector
172
- options={voices}
173
- selectedOption={selectedVoice}
174
- onSelectOption={setSelectedVoice}
175
- />
176
- ```
102
+ 3. **No Hardcoded Credentials**
103
+ - Never store API keys in component files
104
+ - Use environment variables or secure storage
177
105
 
178
- ### Speed Control
106
+ 4. **No Unhandled Errors**
107
+ - Never ignore generation failures
108
+ - Always explain what went wrong
109
+ - Provide retry or alternative options
179
110
 
180
- ```tsx
181
- import { Slider } from 'react-native';
111
+ 5. **No Memory Leaks**
112
+ - Never store multiple audio files in memory
113
+ - Always cleanup audio references on unmount
114
+ - Implement proper audio disposal (unloadAsync)
182
115
 
183
- <Slider
184
- minimumValue={0.25}
185
- maximumValue={4.0}
186
- step={0.25}
187
- value={speed}
188
- onValueChange={setSpeed}
189
- />
116
+ 6. **No Blocked UI**
117
+ - Never block main thread with audio processing
118
+ - Always show progress indicator
119
+ - Allow cancellation
190
120
 
191
- <Text>Speed: {speed}x</Text>
192
- ```
121
+ 7. **No Copyright Infringement**
122
+ - Never generate copyrighted content without permission
123
+ - Never use for voice cloning or impersonation
124
+ - Implement content moderation
193
125
 
194
- ### Audio Player
195
-
196
- ```tsx
197
- import { Audio } from 'expo-av';
198
- import { useState, useEffect } from 'react';
199
-
200
- const [sound, setSound] = useState<Sound | null>(null);
201
- const [isPlaying, setIsPlaying] = useState(false);
202
-
203
- const playAudio = async () => {
204
- const { sound } = await Audio.Sound.createAsync(
205
- { uri: audioUrl },
206
- { shouldPlay: true }
207
- );
208
- setSound(sound);
209
- setIsPlaying(true);
210
-
211
- sound.setOnPlaybackStatusUpdate((status) => {
212
- if (status.isLoaded && status.didJustFinish) {
213
- setIsPlaying(false);
214
- }
215
- });
216
- };
217
-
218
- useEffect(() => {
219
- return sound ? () => sound.unloadAsync() : undefined;
220
- }, [sound]);
126
+ ---
127
+
128
+ ## 🤖 AI Agent Directions
129
+
130
+ ### For AI Code Generation Tools
131
+
132
+ When using this feature with AI code generation tools, follow these guidelines:
133
+
134
+ #### Prompt Template for AI Agents
135
+
136
+ ```
137
+ You are implementing a text to voice feature using @umituz/react-native-ai-generation-content.
138
+
139
+ REQUIREMENTS:
140
+ 1. Import from: @umituz/react-native-ai-generation-content
141
+ 2. Use the useTextToVoiceFeature hook
142
+ 3. Select voice from available options
143
+ 4. Implement text input for speech content
144
+ 5. Adjust settings (speed, pitch)
145
+ 6. Validate text and voice before generation
146
+ 7. Implement audio playback for preview
147
+ 8. Handle long processing times with progress
148
+ 9. Implement proper error handling
149
+ 10. Implement cleanup on unmount (CRITICAL: dispose audio)
150
+
151
+ CRITICAL RULES:
152
+ - MUST validate text and voice before calling generate()
153
+ - MUST implement audio playback controls (play, pause, stop)
154
+ - MUST handle voice selection
155
+ - MUST handle speed and pitch adjustments
156
+ - MUST implement debouncing (300ms)
157
+ - MUST allow regeneration with different settings
158
+ - MUST properly dispose audio on unmount (useEffect cleanup)
159
+
160
+ CONFIGURATION:
161
+ - Provide valid userId (string)
162
+ - Set voice: string (voice ID)
163
+ - Set speed?: number (speech rate 0.25 - 4.0, default: 1.0)
164
+ - Set pitch?: number (pitch adjustment -20.0 - 20.0, default: 0)
165
+ - Set language?: string (language code, default: 'en-US')
166
+ - Implement onSaveAudio callback
167
+ - Configure callbacks: onTextChange, onProcessingStart, onProcessingComplete, onError
168
+
169
+ VOICE OPTIONS:
170
+ - English: Multiple male/female voices (US, UK, etc.)
171
+ - Multi-language: Spanish, French, German, Italian, Japanese, Korean, Chinese
172
+ - Default voice: Set in config
173
+
174
+ SETTINGS:
175
+ - speed: Speech rate (0.25 - 4.0, default: 1.0)
176
+ - pitch: Pitch adjustment (-20.0 - 20.0, default: 0)
177
+ - language: Language code (e.g., 'en-US', 'es-ES')
178
+
179
+ AUDIO CONTROLS:
180
+ - Play: Start audio playback
181
+ - Pause: Pause current playback
182
+ - Stop: Stop and reset playback
183
+ - Unload: Dispose audio resource (CRITICAL for cleanup)
184
+
185
+ STRICTLY FORBIDDEN:
186
+ - No empty text validation
187
+ - No auto-generation without user action
188
+ - No hardcoded API keys
189
+ - No unhandled errors
190
+ - No memory leaks (especially audio)
191
+ - No blocking UI
192
+ - No copyright infringement
193
+
194
+ CLEANUP CHECKLIST:
195
+ - [ ] Audio unloaded on unmount
196
+ - [ ] Sound reference nullified
197
+ - [ ] Event listeners removed
198
+ - [ ] No memory leaks
199
+
200
+ QUALITY CHECKLIST:
201
+ - [ ] Text input for speech content
202
+ - [ ] Voice selector added
203
+ - [ ] Speed control implemented
204
+ - [ ] Pitch control implemented
205
+ - [ ] Validation before generate()
206
+ - [ ] Audio playback controls (play, pause, stop)
207
+ - [ ] Progress indicator during processing
208
+ - [ ] Error display with retry option
209
+ - [ ] Save/share functionality
210
+ - [ ] Regeneration with different settings
211
+ - [ ] Proper cleanup on unmount
221
212
  ```
222
213
 
223
- ## Example Texts
214
+ #### AI Implementation Checklist
215
+
216
+ Use this checklist when generating code:
217
+
218
+ - [ ] Feature imported from correct path
219
+ - [ ] Text input for speech content implemented
220
+ - [ ] Voice selector added
221
+ - [ ] Speed control implemented
222
+ - [ ] Pitch control implemented
223
+ - [ ] Validation before generate()
224
+ - [ ] Audio playback controls (play, pause, stop)
225
+ - [ ] Progress indicator during processing
226
+ - [ ] Error display with user-friendly message
227
+ - [ ] Save/share buttons
228
+ - [ ] Regeneration option
229
+ - [ ] **CRITICAL**: Audio cleanup on unmount
230
+ - [ ] **CRITICAL**: Sound reference disposal
231
+ - [ ] **CRITICAL**: Event listener cleanup
232
+
233
+ ---
234
+
235
+ ## 🛠️ Configuration Strategy
236
+
237
+ ### Essential Configuration
238
+
239
+ ```typescript
240
+ // Required fields
241
+ {
242
+ userId: string
243
+ voice: string
244
+ text: string
245
+ }
224
246
 
225
- ```tsx
226
- const exampleTexts = [
227
- 'Welcome to our amazing product! We\'re excited to have you here.',
228
- 'Once upon a time, in a land far away, there lived a wise old wizard.',
229
- 'Breaking news: Scientists have made a groundbreaking discovery.',
230
- 'The sun was setting over the horizon, painting the sky in orange and pink.',
231
- 'Transform your business with our innovative solutions.',
232
- ];
247
+ // Optional callbacks
248
+ {
249
+ speed?: number // 0.25 - 4.0, default: 1.0
250
+ pitch?: number // -20.0 - 20.0, default: 0
251
+ language?: string // e.g., 'en-US', 'es-ES'
252
+ onTextChange?: (text: string) => void
253
+ onProcessingStart?: () => void
254
+ onProcessingComplete?: (result) => void
255
+ onError?: (error: string) => void
256
+ }
233
257
  ```
234
258
 
235
- ## Advanced Usage
259
+ ### Recommended Settings
236
260
 
237
- ### Custom Voice Options
261
+ 1. **Voices**
262
+ - English: Multiple options (male/female, US/UK)
263
+ - Multi-language: Support for major languages
264
+ - Default: Set in configuration
238
265
 
239
- ```tsx
240
- const result = await feature.generate({
241
- voice: 'en-US-Neural2-A',
242
- speed: 1.2,
243
- pitch: 2.0,
244
- language: 'en-US',
245
- });
246
- ```
266
+ 2. **Speed Settings**
267
+ - 0.25 - 0.75: Slow (audiobooks, learning)
268
+ - 0.8 - 1.2: Normal (most use cases)
269
+ - 1.3 - 2.0: Fast (quick consumption)
270
+ - 2.1 - 4.0: Very fast (skimming)
271
+
272
+ 3. **Pitch Settings**
273
+ - -20 to -5: Lower pitch
274
+ - -5 to 5: Normal range (default: 0)
275
+ - 5 to 20: Higher pitch
276
+
277
+ 4. **Text Length**
278
+ - Recommended: Under 5000 characters
279
+ - Long texts: Consider chunking
280
+ - Short texts: Better for performance
281
+
282
+ ---
283
+
284
+ ## 📊 State Management
285
+
286
+ ### Feature States
287
+
288
+ **isReady**: boolean
289
+ - Text provided and voice selected
290
+ - Check before enabling generate button
247
291
 
248
- ### Long-Form Text
292
+ **isProcessing**: boolean
293
+ - Speech generation in progress
294
+ - Show loading/progress indicator
295
+ - Disable generate button
249
296
 
250
- ```tsx
251
- // For long texts, consider chunking
252
- const longText = '...'; // Your long text
253
- const chunks = longText.match(/.{1,5000}/g) || [];
297
+ **progress**: number (0-100)
298
+ - Generation progress percentage
299
+ - Update progress bar
254
300
 
255
- for (const chunk of chunks) {
256
- const result = await feature.generate({ text: chunk });
257
- // Process each chunk
301
+ **error**: string | null
302
+ - Error message if generation failed
303
+ - Display to user with clear message
304
+
305
+ **result**: {
306
+ audioUrl: string
307
+ voice?: string
308
+ text?: string
309
+ speed?: number
310
+ pitch?: number
311
+ language?: string
312
+ metadata?: any
258
313
  }
259
- ```
260
314
 
261
- ### SSML Support
315
+ ---
262
316
 
263
- ```tsx
264
- // Some models support SSML for advanced control
265
- const ssmlText = `
266
- <speak>
267
- <p>Hello <break time="1s"/> world!</p>
268
- <p>This is <emphasis level="strong">important</emphasis>.</p>
269
- </speak>
270
- `;
317
+ ## 🎨 Best Practices
271
318
 
272
- const result = await feature.generate({ text: ssmlText, useSSML: true });
273
- ```
319
+ ### Text Preparation
274
320
 
275
- ## Best Practices
321
+ 1. **Text Length**
322
+ - Keep under 5000 characters for best results
323
+ - Consider chunking for long texts
324
+ - Test with shorter texts first
276
325
 
277
- 1. **Text Length**: Keep text under 5000 characters for best results
278
- 2. **Voice Selection**: Choose voice that matches your content tone
279
- 3. **Speed**: Use 0.8-1.2 speed for most natural speech
280
- 4. **Punctuation**: Use proper punctuation for natural pauses
281
- 5. **Testing**: Test different voices to find the best match
326
+ 2. **Punctuation**
327
+ - Use proper punctuation for natural pauses
328
+ - Include commas, periods, question marks
329
+ - Use punctuation to control pacing
282
330
 
283
- ## Use Cases
331
+ 3. **Formatting**
332
+ - Clear, readable text
333
+ - Remove unnecessary whitespace
334
+ - Use abbreviations consistently
284
335
 
285
- ### Audiobook Narration
336
+ ### Voice Selection
286
337
 
287
- ```tsx
288
- const result = await feature.generate({
289
- voice: 'en-GB-Neural2-B',
290
- speed: 0.9,
291
- pitch: 0,
292
- });
293
- ```
338
+ 1. **Match Content Type**
339
+ - Audiobooks: Clear, pleasant voice
340
+ - Presentations: Professional voice
341
+ - Entertainment: Dynamic voice
342
+ - Accessibility: Clear, neutral voice
294
343
 
295
- ### Voice Assistant
344
+ 2. **Language Matching**
345
+ - Match voice to text language
346
+ - Consider accent preferences
347
+ - Test different voices
296
348
 
297
- ```tsx
298
- const result = await feature.generate({
299
- voice: 'en-US-Neural2-A',
300
- speed: 1.1,
301
- pitch: 1.0,
302
- });
303
- ```
349
+ ### Settings Optimization
304
350
 
305
- ### Accessibility
351
+ 1. **Speed**
352
+ - 0.8-1.2: Most natural speech
353
+ - Adjust based on content type
354
+ - Test with playback before saving
306
355
 
307
- ```tsx
308
- const result = await feature.generate({
309
- voice: 'en-US-Neural2-A',
310
- speed: 1.0,
311
- pitch: 0,
312
- });
313
- ```
356
+ 2. **Pitch**
357
+ - Keep near 0 for natural sound
358
+ - Small adjustments (-5 to +5)
359
+ - Avoid extreme values
314
360
 
315
- ## Error Handling
361
+ ---
316
362
 
317
- ```tsx
318
- const { state, generate } = useTextToVoiceFeature({ ...config });
363
+ ## 🐛 Common Pitfalls
319
364
 
320
- useEffect(() => {
321
- if (state.error) {
322
- Alert.alert('Generation Failed', state.error);
323
- }
324
- }, [state.error]);
325
- ```
365
+ ### Audio Playback Issues
366
+
367
+ **Problem**: Audio won't play
368
+ ✅ **Solution**: Check audio URL, format compatibility
369
+
370
+ ### Memory Leaks
371
+
372
+ ❌ **Problem**: App crashes after multiple generations
373
+ ✅ **Solution**: Implement proper audio cleanup in useEffect
374
+
375
+ ### Quality Issues
376
+
377
+ ❌ **Problem**: Speech sounds unnatural
378
+ ✅ **Solution**: Adjust speed and pitch, try different voice
379
+
380
+ ### Long Text Issues
381
+
382
+ ❌ **Problem**: Generation fails for long texts
383
+ ✅ **Solution**: Chunk text into smaller segments
384
+
385
+ ### Cleanup Issues
386
+
387
+ ❌ **Problem**: Audio continues playing after unmount
388
+ ✅ **Solution**: Implement proper cleanup with unloadAsync
389
+
390
+ ---
391
+
392
+ ## 📦 Related Components
393
+
394
+ Use these components from the library:
395
+
396
+ - **TextInput**: For speech content
397
+ - **VoiceSelector**: Choose voice
398
+ - **SpeedControl**: Adjust speech rate
399
+ - **PitchControl**: Adjust pitch
400
+ - **AudioPlayer**: Play generated audio
401
+ - **ProgressBar**: Progress display
402
+
403
+ Located at: `src/presentation/components/`
404
+
405
+ ---
406
+
407
+ ## 🔄 Migration Strategy
408
+
409
+ If migrating from previous implementation:
410
+
411
+ 1. **Update imports** to new path
412
+ 2. **Add voice selector**
413
+ 3. **Implement speed/pitch controls**
414
+ 4. **Add audio playback controls**
415
+ 5. **Update state handling** for new structure
416
+ 6. **Implement proper audio cleanup** (CRITICAL)
417
+ 7. **Test all voices**
418
+
419
+ ---
420
+
421
+ ## 📚 Additional Resources
422
+
423
+ - Main documentation: `/docs/`
424
+ - API reference: `/docs/api/`
425
+ - Examples: `/docs/examples/basic/text-to-voice/`
426
+ - Architecture: `/ARCHITECTURE.md`
427
+
428
+ ---
429
+
430
+ **Last Updated**: 2025-01-08
431
+ **Version**: 2.0.0 (Strategy-based Documentation)
326
432
 
327
- ## Related Features
433
+ ---
328
434
 
329
- - [Text to Image](../text-to-image) - Generate images from text
330
- - [Audio Generation](../audio-generation) - Generate audio content
331
- - [Script Generator](../script-generator) - Generate scripts for voiceovers
435
+ ## 📝 Changelog
332
436
 
333
- ## License
437
+ ### v2.0.0 - 2025-01-08
438
+ - **BREAKING**: Documentation format changed to strategy-based
439
+ - Removed extensive code examples
440
+ - Added rules, prohibitions, and AI agent directions
441
+ - Focus on best practices and implementation guidance
442
+ - Added critical audio cleanup guidance
334
443
 
335
- MIT
444
+ ### v1.0.0 - Initial Release
445
+ - Initial feature documentation