100 Days of AI Day 1: From Newsletter to Podcast, Leveraging AI for Audio Transformation

Written by sindamnataraj | Published 2024/01/04
Tech Story Tags: ai | podcast | 100daysofai | machine-learning | code | product-development | openai | api

TLDRvia the TL;DR App

If you don’t know, I write a newsletter called Above Average, where I talk about the second-order insights behind everything that is happening in the big tech. If you are into tech and want to be above average, subscribe to it.

I have always admired Scott Galloway's newsletter, No Mercy, No Malice. One unique thing Scott does with his newsletter is that he hired his friend George Hahn to convert the newsletter into a podcast, which is published every week in his podcast feed here.

I don’t have a friend like George Hahn, but I know AI voices have become very life-like with recent advances. So I thought, why not convert my newsletter into a podcast?

So, I played around and wrote a script to use Open AI’s text-to-speech API to convert my newsletter post into its audio version.

To follow along and use this script, you need Open AI credits and an Open AI Secret Key.

Here is the code I used.

from openai import OpenAI


client = OpenAI()
client.api_key = 'YOUR SECRET KEY'
txt = """1/ Google is the dark horse in AI

Only Google can mess up a good thing multiple times. Google has struggled to play the perception game that has turned against it after the launch of ChatGPT and with Sathya’s offense on all things AI.

Google released an impressive Gemini AI preview series and the success lasted for two days. Before media started to observe that the demo is not so much as a demo but series of well constructed prompts. Or a series of good demos complied to one great demo.

This is obviously putting Google back again in the perception wars of AI. The keyword here is perception.

If everything is perception & marketing than nothing in the world will be a surprise. In case of Google in AI, don’t let the perception confuse you. Google is still the dark horse in AI. Google was talking about AI in every Pixel device launch since last 5 years while the tech industry and VCs were saying that Crypto is the next big thing.

The day to day news cycle exists to take your attention and make you click & confuse you. AI is a continuous innovation not a discontinuous one. Google has strong fundamentals in AI and the AI cycle is much longer than 12 months of ChatGPT. Google has shipped more AI products via Gmail, Google Search, Ads and most importantly Google Pixel than any other company. So just because Google has failed to market itself doesn’t mean its a loser in AI.

Google is still a dark horse in AI."""

response = client.audio.speech.create(
    model="tts-1",
    voice="onyx",
    input=txt,
)

response.stream_to_file("output.mp3")

The newsletter post I took in this example is from this edition. Here is the output result it generated.

The result was not as good as George Hahn’s voice, but it’s much better than most of the audio book out there.

AI PRODUCT ALERT: This idea can be expanded further to create a product that takes a new newsletter when published, converts it automatically to a podcast, and publishes it in the podcast feed. George Hahn as a Service.

That’s it for day 1 of AI.

Follow me on Twitter for the latest updates on 100 days of AI or bookmark this page.


Also published here.


Written by sindamnataraj | Product & Engineering @Microsoft Azure | Host of thestartupproject.io | Investor at Incisive.vc
Published by HackerNoon on 2024/01/04