|
1 | 1 | import React, { useState, useEffect } from 'react'; |
2 | | -import { Mic, FileAudio, Heart } from 'lucide-react'; |
| 2 | +import { Mic, FileAudio, Heart, Wand2 } from 'lucide-react'; |
3 | 3 | import AudioUploader from './components/AudioUploader'; |
4 | 4 | import TranscriptDisplay from './components/TranscriptDisplay'; |
5 | 5 | import { TranscriptResponse } from './types'; |
6 | 6 | import LiveRecording from './components/LiveRecording'; |
7 | 7 | import StandaloneTextToSpeech from './components/StandaloneTextToSpeech'; |
| 8 | +import VoiceChanger from './components/VoiceChanger'; |
8 | 9 |
|
9 | 10 | function App() { |
10 | 11 | const [transcript, setTranscript] = useState<TranscriptResponse | null>(null); |
11 | 12 | const apiKey = import.meta.env.VITE_ELEVEN_LABS_API_KEY || ""; |
12 | 13 | const [currentYear] = useState(new Date().getFullYear()); |
13 | | - const [activeTab, setActiveTab] = useState<'transcribe' | 'tts'>('transcribe'); |
| 14 | + const [activeTab, setActiveTab] = useState<'transcribe' | 'tts' | 'voice-changer'>('transcribe'); |
14 | 15 |
|
15 | 16 | const handleTranscriptReceived = (data: TranscriptResponse) => { |
16 | 17 | setTranscript(data); |
@@ -68,6 +69,16 @@ function App() { |
68 | 69 | > |
69 | 70 | Text to Speech |
70 | 71 | </button> |
| 72 | + <button |
| 73 | + onClick={() => setActiveTab('voice-changer')} |
| 74 | + className={`px-6 py-3 font-medium text-sm transition-colors ${ |
| 75 | + activeTab === 'voice-changer' |
| 76 | + ? 'text-blue-400 border-b-2 border-blue-400' |
| 77 | + : 'text-gray-400 hover:text-gray-200' |
| 78 | + }`} |
| 79 | + > |
| 80 | + Voice Changer |
| 81 | + </button> |
71 | 82 | </div> |
72 | 83 |
|
73 | 84 | {/* Transcribe Audio Tab */} |
@@ -98,6 +109,13 @@ function App() { |
98 | 109 | <StandaloneTextToSpeech apiKey={apiKey} /> |
99 | 110 | </div> |
100 | 111 | )} |
| 112 | + |
| 113 | + {/* Voice Changer Tab */} |
| 114 | + {activeTab === 'voice-changer' && ( |
| 115 | + <div className="mb-12"> |
| 116 | + <VoiceChanger apiKey={apiKey} /> |
| 117 | + </div> |
| 118 | + )} |
101 | 119 | </main> |
102 | 120 |
|
103 | 121 | <footer className="mt-16 text-center text-gray-400 py-6 border-t border-gray-700 animate-fade-in animation-delay-700"> |
|
0 commit comments