ChatGPT-to-Speech: How to Build an AI-Powered Podcast With Python | Daniel Davis | Skillshare

Playback Speed


1.0x


  • 0.5x
  • 0.75x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 1.75x
  • 2x

ChatGPT-to-Speech: How to Build an AI-Powered Podcast With Python

teacher avatar Daniel Davis, Making tech & photography easy

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

    • 1.

      Welcome

      1:56

    • 2.

      Setting Up

      6:11

    • 3.

      Environment Variables

      4:06

    • 4.

      Grabbing RSS Content

      6:06

    • 5.

      Using ChatGPT

      5:41

    • 6.

      Converting to Audio

      10:11

    • 7.

      Tweaking Settings

      5:30

    • 8.

      Wrapping Up

      1:47

  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.

251

Students

--

Project

About This Class

Are you interested in learning how to build an AI-powered podcast generator to convert news headlines into audio files that can be published as podcasts? If so, this course is perfect for you!

In this course, you'll learn how to use Python with the ChatGPT and ElevenLabs APIs to develop an automated podcast generator that can quickly and easily convert news headlines into high-quality spoken audio files. The content is easy to follow with clear explanations.

The skills you'll learn include:

  • Using Python to get content from an RSS feed

  • Generating human-like text using the ChatGPT API

  • Converting text to speech using the ElevenLabs API

  • Creating an MP3 audio file from the text-to-speech output

By the end of this course, you’ll have an understanding of how to use online APIs to build AI-powered applications, as well as the ability to create a functional podcast generator from scratch. You could then upload the resulting audio files to a podcast service, or adapt the program to generate other forms of content such as images or video.

Whether you're a beginner or an experienced programmer, this course is designed to help you develop the skills you need to build your own AI-powered applications. So why wait? Take the course now and start building your own podcast generator today!

Meet Your Teacher

Teacher Profile Image

Daniel Davis

Making tech & photography easy

Teacher


Born in the UK and now living in Japan, I'm a programmer/web developer and a long-time amateur photographer.

Having taught English and computing in the past, I'm building on my experiences to teach subjects where I feel I can help others, concentrating on making technical and creative processes as easy as possible.

My other interests include baking, anything tech-related, and sitting on the sofa strumming a ukulele. 

 

 

See full profile

Level: All Levels

Class Ratings

Expectations Met?
    Exceeded!
  • 0%
  • Yes
  • 0%
  • Somewhat
  • 0%
  • Not really
  • 0%

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.

Transcripts

1. Welcome: Hello and welcome to this video course on how to create an AI-generated podcast from news headlines using Python, the ChatGPT API, and the ElevenLabs API, which are all free. My name is Daniel and I have over 20 years of programming and web development experience. By the end of this course, you'll be able to automatically generate an MP3 audio file from a news RSS feed, which you can then use to create your own podcast. You'll also have learned how to integrate AI and a text-to-speech service into your code. Some of the specific skills that you'll learn include… Using Python to get content from an RSS feed. Generating human-like text using the ChatGPT API. Converting text to speech using the ElevenLabs API. Creating an MP3 audio file from the text-to-speech output. The course is designed to be at a beginner or intermediate level and no Python or AI experience is required. We'll go through each step with clear explanations so that you can then understand how to customize the code if you wish. By the end of the course, you'll have worked on a real-world project that you could show to potential employers or use as a foundation for a podcast, or you'll have an understanding of how to incorporate AI into other projects of yours. The ideal student for this course is someone who is interested in learning about Python, about AI and other third-party APIs, and who wants to know how to automate content creation such as with a podcast. It's for you if you're a blogger, a journalist, a content creator, or a hobbyist who just wants to play with the latest technologies. So, thank you for considering this course. I hope to see you inside. 2. Setting Up: Okay, Let's get into it. But before we actually start coding, there are three things we need to get set up. Python and the various packages that we need. An OpenAI account and API key, and an ElevenLabs account and API key. So Python first. You hopefully have it already installed and to double-check that, you can type "python" at the terminal. And it should show you what you have installed. Here it's saying I've got to 2.7 installed and actually we want Python 3. But I'm on a Mac and it actually has two versions of Python installed. So to specify Python 3, I need to type in "python3". I think for Windows just "python" will be OK if you have Python 3 installed. Anyway, let's exit the Python prompt and try again with Python 3. OK. And it says I have Python 3.10 installed, which is fine. So whichever of those works for you, "python" or "python3", use that as the command for the rest of the course. I'm exiting the Python prompt again. And now we need to make sure we've got the various modules and packages that we need. I've tried to make this easy by creating a "requirements.txt" file, and it should be in the resources for this course. So put it in the directory in which you're currently working. Now I've made a project folder called "ai-podcast-creator". Let's have a look at what's inside that. There we go. Just "requirements.txt". That's all that's in there at the moment, so that's fine. We're going to use that with Pip, which is a Python installer, to automatically grab those packages. The way we do that is with the command "pip". If you need to type in "python3" on your system, then here you should type in "pip3", and then "install -r" and the name of the requirements file, so "requirements.txt". Press "Enter". And it will read that "requirements.txt" file and automatically download and install those packages. I already have them installed. For you it might take a few seconds to download and install them if there's any missing, but then you should be ready to go. So the next stage is the OpenAI and ElevenLabs accounts and API keys. And for that, we need to move to the browser. OK, here in the browser, if you search for" OpenAI API", you might get various guides and explanations and stuff, but what we need is the actual platform itself. So "platform.openai.com". If you don't have an account already, please create one and the free plan is fine. If you do have an account, then this is where you need to sign in. Once you've signed in, you're given a bunch of tokens, bunch of credits to use, and that'll be plenty for our program here. We don't need to worry about paying anything, but we do need to grab the API key. So go over to the account menu and look for the "View API keys" item. I've already created one, yours might be empty here, in which case, click the "Create new secret key" button, and that will show your API key one time only. This is the only time it's going to be on the screen so you need to make a copy now, otherwise you'll lose it. But if you lose it, you can also regenerate another one So it's not really a big deal. Anyway, we want to copy this and we're going to put this in an environment variables file, so we need to switch back to the terminal to create that. Back in the terminal here we have the OpenAI API key in our clipboard, but we need to create a file to store it. And we're going to create a special kind of file called an environment variables file, otherwise known as a ".env". So we want to create that basic text file. I'm going to use the Nano text editor here, but you can use any text editor you like, So "nano" and it's ".env". Please use that naming. Press "Enter". And it's created this empty file and here, I'm going to put a variable name and then paste the API key. So the variable name, I'll use "OPENAI_API_KEY" then "=" with no space. And then here I will paste the API key from OpenAI. Good. I'm going to leave this open because we're going to come back to this in a minute after we've got the ElevenLabs API key, which is again back in the browser. Similar to before, at "beta.elevenlabs.io". Please create an account if you don't already have one. If you do have an account, then sign in here. Once you've signed in, we need to go up to the account menu, and this time it's "Profile" that we click on. Now we can't see the API key here, so we need to click the eye button and that makes it visible. We can see this anytime, you can regenerate a new one anytime. As before, let's copy and paste that and go back over to the terminal. This ".env" file is still open, which is good. So we need to create a new line, and this time we're going to use the same format, but we'll call it "ELEVENLABS_API_KEY" "=", no spaces, and again, we paste the API key there. That's all we need for this file. So we can save and exit this file. If you're using Nano here, then you do CTRL+X and that will ask you to save it. Yes. And we close the file and go back to the terminal. So we have our API keys ready and stored in a ".env" file. We're going to access that with Python. We have all the Python modules installed. We're ready to start programming. 3. Environment Variables: Now for the fun stuff, the programming, and I've got an empty Python file here, which I've called "create_podcast.py". I've made sure this is in the same folder as the ".env" file in which we saved the API keys earlier. So they're in the same folder. Within this program, I'm going to break it up into chunks. And this first chunk is going to be a bit of code which will grab those API keys and just print them out to the screen to make sure that worked. And then we're going to use them in the other sections. So let's concentrate on that first. To do that, we need to first of all, import some modules. And we need three for this section. So the first one is a module that is specifically made for handling the environment variables, the API keys. So "from dotenv", that's the name of the module, and we're going to import just one part of it, which is called "load_dotenv". We're going to use that method. Next thing we need to import is the built-in "os" module. And then finally, it should all be installed already for you, it's called "openai". OpenAI module. Once we have those modules imported, the first thing we'll do is just run the "load_dotenv" function and that'll just sort of prepare it for grabbing the API keys. That's super easy. It's just "load_dotenv()" with brackets. Next, we need to prepare somewhere to store the API keys temporarily within the program, and the OpenAI module has a property specifically for this so we'll use that with "openai". And then the "api_key" property. And we assign the API key that's in our variable file. And here is where we can use the "os" module to grab that. "os.getenv()" And try and remember the name of the variable that we used earlier, and I'm pretty sure it was "OPENAI_API_KEY". OK, now we can do the same thing for ElevenLabs. This time we don't have an ElevenLabs module, so we'll just create our own variable, call it "elevenlabs_api_key". And again that equals "os." get environment variable. And it's called "ELEVENLABS_API_KEY". That should be all we need just to grab the API keys. The reason why we're doing this rather than hard-coding them into the program, is that if we share this program, this code on GitHub or wherever, obviously people will be able to see our API keys if they're in here, and we don't want that, they're supposed to be private, they're supposed to be secret. So we store them in a local environment variable file which will stay on our machine, but then we can freely share this code and the API keys stay secret. Let's make sure this has worked by printing out the API keys to the terminal. So "print(openai.api_key)" and "print(elevenlabs_api_key)". A slight difference between the two there. Right, I'm going to save this and let's go over to the terminal and run it. Here in the terminal, we're going to run the program by typing "python". "python" might be enough for you. In my case, I need to type "python3" and then the name of the file. So it's "create_podcast.py". Press "Enter". And it works. It prints the API keys that we've stored in the environment variables file. Perfect, that means we're ready to move on to the next part, which is actually grabbing content and then getting AI to play with it. 4. Grabbing RSS Content: Let's build up our program a bit more then, but first of all I want to remove these lines that print out the API keys. We don't need those. So we'll get rid of that. What I do need though, is an RSS feed, because I'm going to take the news headlines from an RSS feed and use that as the input for ChatGPT. So, over to the browser and I've got an RSS feed already prepared. I live in Japan, so I'm using one from the Japan Times, the news headlines. And I just want to point out the RSS feed consists of multiple items and each one has got a title, it's got a description, it's got various other elements as well, but I'm just going to stick with the title and the description and combine those as the summary of the news item for ChatGPT. So I just need the URL of this feed and pretty much any RSS feed should do. And I'm going to go back to our program, and let's make a new variable for this. So "news_feed =" that URL. I like to keep these variables at the top of the program so that anybody can come in and change the RSS feed easily later without having to scroll down through all the code. Next, I want to work on actually grabbing the content. And before I do that, I'm just going to print out something to the terminal here that says that we are now processing the RSS feed. And then I'll print out stages for the different parts as we write the program so that when we run the program, we know which bit is being worked on at any one time. We can also see when it fails. When there are errors, we can see which bit those errors in. So let's just, for our own sake, print out "Processing RSS feed". Right, and to do that we need a really good module called FeedParser, which is going to make it super easy for us. So we import it as we did before. "import feedparser" Good. And this means in just a very few lines, we can grab in that content from the RSS feed. Now, we're going to assign the output of the FeedParser processing to a new variable called "feed". And so we use "feedparser" here, and we use one of its methods called "parse". And the argument for that is the URL of the RSS feed so that's just "news_feed" that we prepared earlier. When we grab the feed, we can't give multiple bits of information easily to ChatGPT, what we really want is one bit of content. So I'm going to have one empty variable, I'm going to make it in a minute, and then with each news item I'm going to append the news summary to it. So in the end we'll have one variable which contains all of the news summaries joined together. News stories they are, so I'm going to call the variable "stories" and that's just an empty one to start off with. The RSS feed I'm using, I think it has about 30 items and I don't want that many. I want the podcast to be pretty short, so I'm going to limit it to 10, and I'll create another variable for that to use later. So "stories…", let's call it "stories_limit" equals 10. OK, now we're ready to loop through the "feed" object which should contain all that RSS feed data. To loop through, we're going to create a for loop and let's call each item in the RSS feed "item", because that's what it is. "for item in feed:" And there is a property called "entries". Now that on its own is enough to grab all of the items but as I mentioned, I want to limit it to the first 10. So we can use a clever bit of Python shorthand here and we'll use square brackets, and then we'll use that "stories_limit" here after a colon. So colon and then 10 or "stories_limit" and then a colon at the end because it's a for-loop. And that will automatically truncate all the items down to the first 10. Within each iteration of the loop we're going to build up that empty "stories" variable. So "stories = stories +" because we're appending data to it each time. And because we're appending all of these news stories into one string, I want to make it absolutely clear to ChatGPT when a new story starts. So let's have "New Story: " for the beginning of each one. And then the items in the RSS feed, they have a "title" element and they have a "description" element. So let's grab them by doing "item.title" Put a period after that, and then we'll grab the "item.description". And that should be it for the RSS feed parsing. I want to make sure it works so I'm just going to print out the "stories" variable once everything has been added into it, Let's make sure it's worked by going over to the terminal and running the program. So I'm saving this file. Going over to the terminal. And as before, "python" or "python3" and the name of the file. Press "Enter" and cross your fingers… OK, that was quick. There we go, it grabbed the RSS feed and it's combined everything into one long string. This is perfect as the input for ChatGPT, which we'll do next. 5. Using ChatGPT: Right, we're doing well. We've got the content of the RSS feeds, so let's turn to ChatGPT. I'm going to delete this print line there. We don't need to print out the "stories" variable anymore, but I am going to add a line that prints out the next stage of processing. So we'll say "Processing ChatGPT". With this one, we're going to use the OpenAI module which we've already imported. So there's no new modules to import. To use that we need to assign the result or the output of ChatGPT into a variable. So let's call it "chat_output". This will be from the "openai" module and there is a service called "ChatCompletion". They have other services such as image generation, things like that, but we're using a text chat here. And within that there is a "create" method. The "create" method takes various arguments, but it needs at least two, and they are "model" and – oops, forgot the comma – "messages". And "messages" is actually an array. First of all, with "model", this can specify the AI model that we want to use. There'll probably be many things to choose from in future but at the moment you've pretty much got GPT 3.5 currently. So "gpt-3.5" and there is one called "turbo". And this is the most advanced publicly available AI model. In future this will probably change so please keep an eye on their API documentation to find out what the latest and greatest is. So for now, the "model" is "gpt-3.5-turbo". And "messages" is an array of objects. Each object has a "role" and "content", and we're just going to use one object to keep it simple. So we want a "role" because it's an object here, I'm going to use "role" and "content". The "role" can be one of three things. "user", which is the role that actually sends the command or the requests to ChatGPT. "system", which is sort of informing ChatGPT what it is. So for example, "you are a helpful, polite assistant", something like that. And then "assistant" is the third role, and that could be some kind of background information, for example if you're sending it a bunch of data, you could say "this data was collected in March 2023", something like that. We don't need that kind of stuff. We're just going to stick with the one role of the basic command, and that means the "role" will be "user". The "content" is the actual request that we send to ChatGPT. I've done various trial and error here and I've come up with quite a long command, so I'm going to paste that in to save time. And there it is. "Please rewrite the following news headlines and summaries in a discussion way…", like a chatty kind of way, as though someone is talking about them on a podcast. As you can see, I've added various sort of extra bits here because I had to keep tweaking it to get what I really wanted. And obviously you can tweak that as well listening to the output. So that's the request but obviously we need to include the news headlines themselves, so at the end of this request I'm going to just append the "stories" variable. Good. That is going to grab the output from ChatGPT but it's also going to give us a few other things as well, and we just want the core content, the core response. So let's extract that by creating a new variable "chat_content". And we're going to grab it from the "chat_output" that we just created. And within that, there will be a "choices" array, and we just want the first item, zero item from the "choices" array, and then "message" and then "content". So that's kind of the fixed sort of way that we drill down to get just the content that ChatGPT returns. That should be it so let's see if it's worked by printing it out to the terminal as before: "print(chat_content)" And I'm saving that and now I'll go over to the terminal and give it a try. I'm going to run the program here but first of all, you may or may not know this, but if you press the up (↑) arrow on your keyboard in the terminal, it will go through commands that you previously typed in so you don't need to type them again. So I've just pressed up a couple of times and this is the one I want, "create_podcast.py", press "Enter", and it's running the program. And no errors so far, that's good. So now we just wait for ChatGPT to return something. And there we go, took a few seconds, but that looks pretty good, no errors. And just reading through this, it looks nice, sort of good, kind of podcast sort of content. And I'm always impressed that it's grabbed this from news headlines and then been able to convert it into something that looks pretty natural. So what we need to do next is convert this into audio using the ElevenLabs API. 6. Converting to Audio: Well this is going well so far so let's move on to the next part which is to actually generate the audio output. And as before, I'm going to just print out a line to say what's happening. So "Processing audio", something like that. OK, now there isn't an ElevenLabs module for Python. Instead, we're going to be using a couple of things. We're going to be using a "json" module because we're going to be handling JSON format data. And we're going to be importing a "requests" module which will deal with actually sending POST requests over the internet. So to import those, we go back to the top of the program, "import json", and then "import requests". Now when we deal with the ElevenLabs API, there are actually various voices that we can use, and so we have to specify the voice that we want by specifying the voice ID. That's all listed in the ElevenLabs API documentation so I won't go through it here, but I have one already ready so I'm going to add that first of all to a new variable, and I'll call it "voice_id". And that's the ID, difficult to remember so I pasted it in. It's actually for a female American voice called Rachel and I think it sounds very natural so that's why I'm going with that one. Next, we want to use the "requests" module to actually send this request and grab the response. To do that, let's have a new variable to store the output in, so "audio_output". We're going to use the "requests" module and we actually have to send POST data. So "post" is the method and then there are three arguments that we're going to use in the "post" method. The first argument for the "post" method is just the URL of the API. That's just a string, and I've got it in the clipboard, so I paste that in. But we also need to add the voice ID of the voice that we want, so append "voice_id". The next two arguments are "data" and "headers". So let's deal with "data" first. And the data will be in a JSON format. So "data =" and here we use the "json" module, and it has a method called "dumps" which will accept a JSON object. In this object, we'll put two things, "text" and "voice_settings". "text" is quite easy because we've already got it ready, and that is the output from ChatGPT. So it's "chat_content". And then the "voice_settings"… Let me just move this up up the page a bit. "voice_settings" is another object with, in the case of ElevenLabs, just two settings for how we can control the tone or the expressiveness of the voice. The two settings are "stability" and "similarity_boost". First of all "stability". These are both values between zero and one. And "stability" is what it sounds like. The voice sounds quite stable when you have a high value and much more expressive when you have a low value. I'm going to set it at 0.2. I've tried a few things and I quite like 0.2. In the following video, I'll explain what these mean and I'll demonstrate a bit how you can change these settings. But first of all let's stick with 0.2. And then "similarity_boost". I've not found this makes much difference so I'm just going to stick with zero for that one. Then we move on to the "headers" argument of this "post" method. So "headers", the third argument, is also an object and this time with three properties. The first one is "Content-Type" which will be "application/json", because we're sending a JSON object. We're also sending an API key. That's the next property. And so we need, in this case, "xi-api-key". And we don't want to type it directly in the program here, but that's OK because we've already got it as a variable that we created right at the beginning. So we can use "elevenlabs_api_key" that we prepared. And the third property is the format of the data that we want to receive. And we actually want audio format. So we can "accept" and this will be "audio/mpeg". OK, that's all we need. And so we have the "post" method ready to be sent. And what we need to do next is deal with the response with the output that we get back. I'm going to just move the code up a little bit. And within the output from ElevenLabs there will be a thing called a status code which will tell us whether it's worked or not, so I think it's a good idea to grab that and check first of all. So "if audio_output", which is the object, and then within that the "status_code" property, if this equals 200, then it means everything has worked. So let's just put a placeholder there. "Do something." Otherwise, we want to print out something to tell us that it hasn't worked. So we're going to print out to the screen a message from the audio output. So ElevenLabs will include an error message if there was a problem. That's what we want to print out. So "audio_output", and that is a "text" property there. So if something goes wrong, we'll be able to understand whether it's because we run out of credits or something else. I have found that ElevenLabs does use up quite a lot of credits pretty quickly because the audio generation is quite intensive. Anyway, that's in case something goes wrong but hopefully it'll all go right, in which case we can now, in this "do something" line, convert that audio that we've received into an audio file, an MP3 file. So we're going to use the "with" command. So "with" and then we're going to "open" an audio file and we'll call it "test.mp3". You can call it whatever you like and if it doesn't exist, it will automatically create it. But we need to add a couple of flags here, "w" and "b". "w" means write, so it's in write mode, we can write content to the MP3 file, and "b" means it's binary data, a binary file. OK, and then we need to just assign a name to this output file so we'll call it "output_file". With this file, we're going to write the content of the audio that we received from ElevenLabs. So with this file, "output_file.write()" – what are we going to write to it? We're going to write the content of the audio output. So "audio_output", and that has a "content" property. That should be everything that we need to create the audio file. So to finish off, let's just have one more line to print out that everything's finished. "Processing complete" or something like that. I'm going to save this file, and now if we run it and cross our fingers, it should work. So over here in the terminal one more time, I'm going to press the up arrow on my keyboard. "create_podcast.py" – let's go. So as before, It's going and it's grabbed the stuff in the RSS feed already. That was quick. It's now using ChatGPT to convert that into a more kind of chatty discussion kind of style. OK, it has got some text. It's probably not identical to the text that we had before, but it still looks pretty good. And so this is now going to be recorded, if you like, by the AI voice and hopefully saved as a file called "test.mp3". OK, that just finished and didn't show any error messages, which is great. So now let's go over to the folder in which we've been working. Right, there is a file called "test.mp3" It's 1.2 Mb, which looks good. Let's play it. "Hello and welcome to today's podcast where we will be discussing some of the latest news stories out of Japan." "First up…" It works! It works. I hope you can hear that, and it is amazingly realistic to me. I'm very impressed. We can go and look at the content in the terminal and see that she is actually reading that. "Japan and South Korea are eyeing a package to…" Yep, sounds really good. Wow. So we've created our program, you should feel very proud of yourself, and it works. We've got an audio file, so that's it really, but I do want to go over in the next video just a couple of ways you can tweak the settings here to change the feeling or the tone or the expressiveness. So, see you in the next video. 7. Tweaking Settings: So everything works. That's great, but I just want to show you a couple of ways where you can control what comes out of both ChatGPT and audio. We'll do ChatGPT first and for that, I actually want to delete the audio section just temporarily because I don't want to waste credits generating audio when it's the ChatGPT bit that I'm focusing on. So that'll do for now. The "create" function that we saw earlier for ChatGPT needs at least two arguments. There are several others, and you can see the API documentation to understand all the different arguments that are available to you. But the one that has the most impact that I've found, is "temperature". And you can think of this as like creativity. It goes from 0 to 2. I think the default is 1. And 0, relatively no creativity, means you're pretty much going to get back the same or very nearly the same response every time you run that same command. A high number, the maximum 2, will give us a lot of creativity and that's what I want to show here. So let's use a temperature of 2. Save this, and we'll go over and run the command again. There we go. Oh, this is very creative! So it kind of starts off OK. "Welcome to our podast today, where we are discussing…" blah, blah, blah. But as you can see, as we go further and further down, it's just rubbish! So this is really creative. So you probably never want to use the "temperature" as a value of 2. The lowest one, 0, as I mentioned, it'll give you probably a much more stable output and pretty much the same thing every time. It depends what you want. You can stick with that predictable output. The default, I find, is absolutely fine. I generally tend to leave it blank. I don't use the "temperature" argument unless I want to control its creativity. But this is not very helpful! Anyway, that's up to you, you can play about with that. Let's look at the audio controls now. For the audio settings, there's pretty much just two. Two voice settings: "stability" and "similarity_boost" that we saw earlier. First of all, "similarity_boost". This is most effective when you have a custom voice and you can do this… I think you might have to be on a paid plan with ElevenLabs, but you can provide voice samples and it will try to create an AI voice very similar to that, and so you can use a "similarity_boost" to make it very similar or a little bit less similar. If you have it very high, there can be artefacts I think that start to appear. I've found it doesn't have much effect when we're using the built-in voices. A higher number sounds a little bit clearer maybe, but there is some risk of artefacts coming in according to the API documentation. So I've just been leaving it at 0 and it's been fine. The "stability" setting has more of a difference, and it's a little bit like the "creativity" setting of ChatGPT. It controls the expressiveness of the voice. And so a higher number makes it more stable, a little bit boring actually. And a low number is… the voice is very expressive. Now rather than generating and using up my credits, I've actually created two test files so it's much faster for us to listen to the difference between those two settings. I have a couple of sample files that I've prepared here and let's listen to the first one with the maximum possible stability of 1. "Hello. This is a sample of the voice called Rachel from ElevenLabs with a stability setting of one and a similarity boost setting of zero." OK, It sounds pretty good, pretty natural, but also kind of boring. So let's try with a stability setting of 0 which is the minimum allowed value. "Hello. This is a sample of the voice called Rachel from ElevenLabs with the stability setting of zero and a similarity boost setting of zero." Wow, she's really excited about that! That is possibly too expressive. I've tried it with a few samples and going down to 0… let's go back to the program for a second. Yeah, the "stability" setting of 0 really is too much for me. I like 0.2. I've seen other people in discussion forums recommend anything between 0.2 to 0.4. So go with those and a "similarity_boost", You can try playing around with that, but generally 0 or even 1 is gonna be fine. There's not a huge difference. So those are the ways you can control the output from ChatGPT and the ElevenLabs audio. Just be careful because the audio processing is much more intensive and therefore you're going to use up your ElevenLabs credits much faster than ChatGPT ones. What I recommend is each time you generate a new audio file, maybe make a copy of it and keep a record of the "stability" and the "similarity_boost" settings that you used so that if it gets overwritten, you've still got that copy. You can refer to as a sample file in the future. Anyway, I think we're done. All that's left now is just to recap on what we've learned. 8. Wrapping Up: So there we go. You now know how to easily create an AI-powered podcast from just news headlines. And we've hopefully learned a lot over the course so let's quickly recap over the specific skills that we've covered. Using Python to get content from an RSS feed. Generating human-like text using the ChatGPT API. Converting text to speech using the ElevenLabs API. Creating an MP3 audio file from the text-to-speech output. I hope you've enjoyed the course and found it useful. Now that you've completed it, the skills you've learned could be used for a variety of different projects in future. You could obviously automatically generate audio files on a daily basis or a weekly basis, and then upload them to your preferred podcast host. Some examples include BuzzSprout, SimpleCast, or TransistorFM. You could alternatively use the code that we've developed to use other online services such as image generation or even video generation. It should be pretty easy to tweak the code to use a variety of online APIs. Finally, I want to thank you for joining me in this course. It's been a pleasure teaching you and please remember, practice makes perfect, so keep honing those coding skills and create interesting projects, and very importantly, have fun along the way. If you have any feedback or questions, then feel free to leave them in the discussion section. And if you haven't already, please consider leaving a review to help other learners find and benefit from this course. So that's it from me and I wish you all the best in your coding adventures.