The VoiceTranscriber
toolkit is an integral part of the OpenAI with unity asset, enabling the conversion of speech to text. This tool is ideal for applications requiring voice command recognition, dialogue systems, accessibility features, or any functionality where user voice input needs to be interpreted as text.
In Unity's top menu, navigate to Assets > Create > Glitch9/OpenAI/Toolkits > Voice Transcriber
.
A VoiceTranscriber
instance will appear in your project directory. Click on it to adjust its properties in the Inspector.
Audio File Path: Set the path where audio recordings will be saved.
Review additional properties that may be provided for more advanced settings and preferences.
Assign the VoiceTranscriber
ScriptableObject to a controller script within your scene that will handle voice recording and transcription.
Add a reference to the VoiceTranscriber
in your script to invoke its methods for recording and transcribing audio.
Use the StartRecording
method to begin capturing audio from the user's microphone.
Once the desired audio has been captured, call the StopAndTranscribeRecordingAsync
method to end the recording and start the transcription process.
The transcription result will be contained within the AudioFile
object returned by the StopAndTranscribeRecordingAsync
method, including both the audio clip and the transcribed text.
Maintain a reference to the audio recordings and transcriptions using the GetRecordings
method, which provides access to all recorded and transcribed sessions.
Adjust settings such as recording duration and audio frequency for optimized performance specific to your application's environment and requirements.
Implement error handling to manage potential issues during recording or transcription.
Provide users with feedback when recording starts and ends, and inform them of any errors or transcription status updates.
Test and calibrate the microphone input settings in various environments to ensure reliable voice capture.
Prompt users to speak clearly and consider implementing a voice activity detection system to initiate and terminate recordings efficiently.
Handle personal user data responsibly, especially if recording sensitive information.