From the course: Building Apps with AI Tools: ChatGPT, Semantic Kernel, and Langchain

Unlock this course with a free trial

Join today to access over 24,800 courses taught by industry experts.

Learning to use Whisper for text to speech

Learning to use Whisper for text to speech

- [Instructor] Speech-to-text was a futuristic technology 10 years ago, but today it's part of everyday life. We're going to learn how to use an open source text-to-speech model called Whisper. Let's open up our branch, 03_04b and here we can see we've imported the OpenAI Python package, since Whisper was developed by OpenAI. We're going to access the cloud version of the model. I also have a recorded file here. This comes from a Stanford data set that some students have collected. So let's go ahead and get started. I'm going to go ahead and read that file into memory. So I'm going to type with open, and let's get our current directory, so current directory /"src" and /"lost_debit_card.wav", and we're going to open it up as a binary file. And there we go. Okay, so we've opened up this file, let's go ahead and get its transcript. So we're going to say, transcript equals openai.Audio.transcribe, and we're going to…

Contents