Skip to content

Looping through list of podcast episodes using Python #49

Closed Answered by geekchick
johnkmayo asked this question in General help
Discussion options

You must be logged in to vote

You could do something like the below example I created. The only difference is the files are on my local machine in a folder called speeches and not hosted.

from deepgram import Deepgram
import asyncio, json
import os

DEEPGRAM_API_KEY="DEEPGRAM_API_KEY"

async def get_audio_files():
    path_of_the_speeches = 'speeches'
    for filename in os.listdir(path_of_the_speeches):
        audio_file = os.path.join(path_of_the_speeches,filename)
        if os.path.isfile(audio_file):
            await main(audio_file)


    return audio_file



async def main(file):
    print(f"Speech Name: {file}")

    # Initializes the Deepgram SDK
    deepgram = Deepgram(DEEPGRAM_API_KEY)
    # Open the audi…

Replies: 4 comments 10 replies

Comment options

You must be logged in to vote
6 replies
@geekchick
Comment options

@geekchick
Comment options

@johnkmayo
Comment options

@geekchick
Comment options

@johnkmayo
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by johnkmayo
Comment options

You must be logged in to vote
4 replies
@johnkmayo
Comment options

@geekchick
Comment options

@johnkmayo
Comment options

@geekchick
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants