AlterEgo is a C# desktop application inspired by the Danganronpa series, featuring an AI assistant with speech recognition, text-to-speech synthesis, and dynamic character animations. This interactive assistant communicates using OpenAI's GPT model, bringing your AI conversations to life!
✅ Speech Recognition - Converts spoken words into text.
✅ AI-Powered Responses - Uses OpenAI's GPT model to generate realistic conversations.
✅ Text-to-Speech (TTS) - Reads responses aloud for a more immersive experience.
✅ Dynamic Character Animations - Changes character expressions based on interactions.
Ensure you have the following installed:
- .NET Framework 4.7.2 or later
- Newtonsoft.Json (for JSON handling)
System.Speech(for speech recognition and synthesis)
git clone https://github.com/Megamer-studios/AlterEgo/
cd AlterEgo- Obtain an OpenAI API key from OpenAI.
- Replace
API KEY HEREinGetChatGPTResponse()with your actual API key.
- Run the application.
- Click the speech recognition button to speak to the AI.
- Wait for a response - the AI will process your input and reply via text and voice.
- Enjoy dynamic visuals - the character sprite changes based on interactions.
- Initializes the UI and loads the default character sprite.
- Configures the speech synthesizer to use a female voice.
- Sets console text color for debugging.
- Sends user input to OpenAI's GPT model.
- Implements exponential backoff retry logic for handling API rate limits.
- Returns the AI-generated response or an error message if unsuccessful.
- Uses
SpeechRecognitionEngineto capture and transcribe speech. - Displays the recognized text in
richTextBox1. - Passes the transcribed text to the AI via
oshit(result.Text).
- Sends the recognized speech or text input to OpenAI.
- Updates
richTextBox2with the AI-generated response. - Uses
synth.Speak(response)to read the response aloud. - Activates a timer to trigger character animations.
- Randomly selects one of five character sprites to display.
- Creates a more dynamic and engaging user interface.
- Triggers speech recognition when the user clicks Button 1.
📌 Newtonsoft.Json - JSON serialization/deserialization.
📌 System.Speech - Speech recognition and synthesis.
🚀 Pull requests are welcome! For major changes, please open an issue first to discuss proposed modifications.
For any issues, feel free to contact [cozoral@outlook.com].
