20,000+ Professional Language Experts Ready to Help. Expertise in a variety of Niches.
Unmatched expertise at affordable rates tailored for your needs. Our services empower you to boost your productivity.
GoTranscript is the chosen service for top media organizations, universities, and Fortune 50 companies.
Speed Up Research, 10% Discount
Ensure Compliance, Secure Confidentiality
Court-Ready Transcriptions
HIPAA-Compliant Accuracy
Boost your revenue
Streamline Your Team’s Communication
We're with you from start to finish, whether you're a first-time user or a long-time client.
Give Support a Call
+1 (831) 222-8398
Get a reply & call within 24 hours
Let's chat about how to work together
Direct line to our Head of Sales for bulk/API inquiries
Question about your orders with GoTranscript?
Ask any general questions about GoTranscript
Interested in working at GoTranscript?
Speaker 1: Hello, my name is Kevin Lewis and I'm a Developer Advocate here at DeepGram, and today I'm going to show you how to transcribe the latest episodes from your favorite podcasts directly in your terminal. DeepGram is an API for transcribing and understanding audio, and we'll be using it today for the transcription. So you'll need to sign up for a free DeepGram API key, which you can get at console.deepgram.com. You're also going to need a couple of command line utilities, jq and xq. I will leave the link to those in the description. We'll be using them to parse XML and JSON data in our terminal. The final thing we'll need is a podcast RSS feed URL, and so you can grab that. Every single podcast has one, and we'll be needing that today in order to transcribe them. This is what we'll be building today, a project that once run, it will go and generate transcripts directly in your terminal, so you can go ahead and read them. Let's get started. The first thing you'll need is a podcast feed URL. This is for the Pop Culture Happy Hour from NPR, and we've gone ahead and stored it in this URL variable. Let's curl it to see what's at this URL, and you'll see here that this is an XML document. XML is similar to HTML, so we have a bunch of opening and closing tags, and each one of these items represents one episode. Right here at the bottom of the document is the oldest episode, and up at the top will be the newest. Inside of the item are a bunch of additional tags, each containing some data or metadata about this episode. Now let's curl the podcast feed URL again, except this time we're going to pipe the output to a command line utility, xq. xq allows us to pass and manipulate XML data directly in our terminal. So as you can see, this is now representing that same XML data at the URL, but in JSON. Same data, but different format. And the cool thing about these square brackets is that we can start to specify which items we want returned. So if we put in a zero, we only get the first item, the latest item. Or if we do colon three, we'll get the first three. And you can see there that that has returned an array directly here in our terminal. From each of the items in the array, we want to extract just the information we need. So we're going to map that array into a new array with just the title and the URL for each episode. Now store the output from this request inside of a data variable. We're now going to write a loop which will loop through each item in this array and just echo it to the terminal so we can see what it does. And this might not be what you expect. Bash doesn't actually have a concept of objects. Instead, every time it encounters a space or a new line, it's starting the loop again. Now what we want to do here is follow a guide from Stark & Wayne's Ruben Costa on how you can loop through objects in Bash. Create a new variable called encoded, and inside of that, echo the data. And then using jq, we're going to base64 encode it, meaning that every single one of those objects will now be converted into one long string. Given that encoded now contains just three strings, one representing each object, we can go ahead and repeat that loop, this time using the encoded variable. Inside of the loop, we have to use a helper function to decode the base64 encoded string and access individual properties. So using that helper function here, we are extracting just the URL property, like so. So starting with the same loop as before, I'm going to remove the echo which just prints the URL. I'm then going to make a DeepGram API request directly here in our terminal and store the response inside of a variable called response. Now a few things to note here. Firstly, we're using the punctuate feature, which means that our return transcripts will also have punctuation, which will make them nicer to read. We're also using the enhanced tier transcript, which will provide even more accurate transcripts. I also want you to note that we are passing in our DeepGram API key in a header here, and I stored that in a variable called dgKey before I started recording. Finally, we pass in the URL in an object, which we pass as a body. The response is a huge JSON object that contains not only our transcript, but a bunch of other useful metadata. For this example, though, we want to extract just the transcript. So we pipe the response into jq to extract the transcript and then send that into a brand new text file, which is the name of the podcast episode, .txt. And now that this command is running, each of those URLs are being sent to DeepGram one after another for an enhanced tier transcript. These three podcast episodes represent over an hour of audio, and it's just completed. That took just 20 seconds. If you used a competitor, this would take multiples longer. That was an enhanced tier transcript in just 20 seconds for over an hour of audio. I've cleared our terminal. Let's see what is in this directory. And we can see that there are three episodes from the pop culture, Happy Hour. Let's look at one of them and compare it to the original audio.
Speaker 2: Serena Williams recently played what might be her final professional tennis match. With 23 singles, Grand Slam titles to her name and more in doubles and mixed doubles, she's had a singular, remarkable career. Along the way, she's had an enormous impact on culture inside and outside sports. And even as she steps away from this phase of her life in tennis, she's started more conversations about the way athletes' public lives change as they get older. I'm Linda Holmes, and today we're talking about tennis superstar Serena Williams on Pop Culture Happy Hour from NPR.
Speaker 1: So there you have it, three of the latest episodes from my favorite podcast transcribed directly in the terminal. Of course, you can do it for any podcast and build upon this project in fun and interesting ways. If you prefer reading or you want to reference the final code, we actually also did this topic as a blog post. I will link that down in the description also. And if you have any questions at all, please feel free to get in touch. We love helping you build awesome things with voice. Bye for now.
Generate a brief summary highlighting the main points of the transcript.
GenerateGenerate a concise and relevant title for the transcript based on the main themes and content discussed.
GenerateIdentify and highlight the key words or phrases most relevant to the content of the transcript.
GenerateAnalyze the emotional tone of the transcript to determine whether the sentiment is positive, negative, or neutral.
GenerateCreate interactive quizzes based on the content of the transcript to test comprehension or engage users.
GenerateWe’re Ready to Help
Call or Book a Meeting Now