souzatharsis / podcastfy

An Open Source Python alternative to NotebookLM's podcast feature: Transforming Multimodal Content into Captivating Multilingual Audio Conversations with GenAI
https://www.podcastfy.ai
Apache License 2.0
1.13k stars 122 forks source link

Audio files combing fails #184

Closed ahadda5 closed 4 days ago

ahadda5 commented 5 days ago

Running the following code segment in ipynb

audio_file = generate_podcast(
    urls=urls,
    llm_model_name="gpt-4-turbo",
    api_key_label="OPENAI_API_KEY" # Note that this is not the API KEY value itself, but instead the label as contained in your .env file
)
embed_audio(audio_file)

The audio files gets generated properly and can temporarily be seen under data/audio/tmp folder. However on merging them i get the following exception. not sure where ffprobe is probably some dependency. Once the exception happens it rolls back and the files are gone.

Error merging audio files: [Errno 2] No such file or directory: 'ffprobe'
Error converting text to speech: [Errno 2] No such file or directory: 'ffprobe'
2024-11-17 13:42:42,242 - podcastfy.client - ERROR - An error occurred in the process_content function: [Errno 2] No such file or directory: 'ffprobe'
2024-11-17 13:42:42,243 - podcastfy.client - ERROR - An error occurred: [Errno 2] No such file or directory: 'ffprobe'

File ~/podcastfy/lib/python3.12/site-packages/podcastfy/client.py:372, in generate_podcast(urls, url_file, transcript_file, tts_model, transcript_only, config, conversation_config, image_paths, is_local, text, llm_model_name, api_key_label, topic, longform)
    [366](https://file+.vscode-resource.vscode-cdn.net/podcastfy/~/Documents/Devs/podcastfy/lib/python3.12/site-packages/podcastfy/client.py:366)         if not urls_list and not image_paths and not text and not topic:
    [367](https://file+.vscode-resource.vscode-cdn.net/podcastfy/~/Documents/Devs/podcastfy/lib/python3.12/site-packages/podcastfy/client.py:367)             raise ValueError(
    [368](https://file+.vscode-resource.vscode-cdn.net/podcastfy/~/Documents/Devs/podcastfy/lib/python3.12/site-packages/podcastfy/client.py:368)                 "No input provided. Please provide either 'urls', 'url_file', "
    [369](https://file+.vscode-resource.vscode-cdn.net/podcastfy/~/Documents/Devs/podcastfy/lib/python3.12/site-packages/podcastfy/client.py:369)                 "'transcript_file', 'image_paths', 'text', or 'topic'."
    [370](https://file+.vscode-resource.vscode-cdn.net/podcastfy/~/Documents/Devs/podcastfy/lib/python3.12/site-packages/podcastfy/client.py:370)             )
--> [372](https://file+.vscode-resource.vscode-cdn.net/podcastfy/~/Documents/Devs/podcastfy/lib/python3.12/site-packages/podcastfy/client.py:372)         return process_content(
    [373](https://file+.vscode-resource.vscode-cdn.net/podcastfy/~/Documents/Devs/podcastfy/lib/python3.12/site-packages/podcastfy/client.py:373)             urls=urls_list,
    [374](https://file+.vscode-resource.vscode-cdn.net/podcastfy/~/Documents/Devs/podcastfy/lib/python3.12/site-packages/podcastfy/client.py:374)             tts_model=tts_model,
    [375](https://file+.vscode-resource.vscode-cdn.net/podcastfy/~/Documents/Devs/podcastfy/lib/python3.12/site-packages/podcastfy/client.py:375)             generate_audio=not transcript_only,
    [376](https://file+.vscode-resource.vscode-cdn.net/podcastfy/~/Documents/Devs/podcastfy/lib/python3.12/site-packages/podcastfy/client.py:376)             config=default_config,
    [377](https://file+.vscode-resource.vscode-cdn.net/podcastfy/~/Documents/Devs/podcastfy/lib/python3.12/site-packages/podcastfy/client.py:377)             conversation_config=conversation_config,
    [378](https://file+.vscode-resource.vscode-cdn.net/podcastfy/~/Documents/Devs/podcastfy/lib/python3.12/site-packages/podcastfy/client.py:378)             image_paths=image_paths,
...
-> [1955](https://file+.vscode-resource.vscode-cdn.net/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py:1955)     raise child_exception_type(errno_num, err_msg, err_filename)
   [1956](https://file+.vscode-resource.vscode-cdn.net/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py:1956) else:
   [1957](https://file+.vscode-resource.vscode-cdn.net/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py:1957)     raise child_exception_type(errno_num, err_msg)

FileNotFoundError: [Errno 2] No such file or directory: 'ffprobe'
ahadda5 commented 5 days ago

image

souzatharsis commented 5 days ago

Are the audio files non-empty?

On Sun, Nov 17, 2024, 6:54 AM ahadda5 @.***> wrote:

image.png (view on web) https://github.com/user-attachments/assets/a4660b4e-99ce-47d9-8231-5d1de5e0b9bb

— Reply to this email directly, view it on GitHub https://github.com/souzatharsis/podcastfy/issues/184#issuecomment-2481094625, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADTMY3ONVYMQ5QJHLEZCQYT2BBRWTAVCNFSM6AAAAABR5YIHBCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOBRGA4TINRSGU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

ahadda5 commented 5 days ago

Yes. could hear them loud and clear :)

this is MacOS Python 3.12. (venv) ffmeg and podcastfy - installed with no issues using pip.

souzatharsis commented 5 days ago

Could you please confirm your OS?

Also please run pip install ffprobe

On Sun, Nov 17, 2024, 6:56 AM ahadda5 @.***> wrote:

Yes. could hear them loud and clear :)

this is MacOS Python 3.12. (venv) ffmeg and podcastfy - installed with no issues using pip.

— Reply to this email directly, view it on GitHub https://github.com/souzatharsis/podcastfy/issues/184#issuecomment-2481096861, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADTMY3MUXIC4W6FRFMJI4NT2BBR5RAVCNFSM6AAAAABR5YIHBCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOBRGA4TMOBWGE . You are receiving this because you commented.Message ID: @.***>

ahadda5 commented 4 days ago

had to > brew install ffmpeg My guess pip didn't do it.