This guide will teach you how to use the Streamlit st.audio_input widget to record your voice on your device microphone paired with the OpenAI Whisper model to transcribe and/or translate your speech to text in English. You can later download the transcribed content as a text file in the .txt format.
Prerequisites
- Basic
- OpenAI API key. , Streamlit is a faster way to build and share data apps. It is an open-source Python library that helps you build web applications for sharing analytical results, building complex interactive experiences, and iterating on top of new machine-learning models.
Streamlit is a top choice for Python developers because it has built-in and convenient methods, from taking in user inputs like text, numbers, and dates to showing interactive graphs using the most popular and powerful Python graphing libraries.
Installing Streamlit
To run any Streamlit apps, you must first install Streamlit using the command:
CODEpip install streamlit
Installing Other Libraries
Since we are working with transforming audio to text, we need to store our environment variables securely.
CODEpip install openai python-dotenv
Creating the Environment Variable
Create a new file in the root project directory and name it
.env.
Paste in your OpenAI will convert our audio using the
st.audio_inputwidget to record our voice. If the recording exists, the model, Whisper is used to create the desired file format for the transcription of the audio and output the text using thest.write()function which takes a string and writes it directly into our web app.
To use the exact logo at the top left of the app,
Translation with Whisper
The process of creating the translation is similar to creating the transcription. The and give , Streamlit offers you the opportunity to use your voice and pair it with the transcription and translation endpoints provided by OpenAI to create this outstanding project.
The microphone in your device can do so much as technology has made it possible to go beyond using it for communication during meetings and calls.
↗ Original-Artikel auf dev.to lesenVollständiger Original-BerichtAusführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
SOCIAL SHARE CARD GENERATOR