Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds splitting audio file cookbook #152

Merged
merged 3 commits into from
Feb 28, 2025
Merged

Conversation

MerlynTheWizard
Copy link
Contributor

Adds a cookbook on how to split audio files that are too big for Salad Transcription API to files of 2.5 hours or less.

Copy link
Contributor

@mgorkii-nlplogix mgorkii-nlplogix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few comments:

  1. You are using "input_file" vaiable in split_audio function, but it is not passed into it as an argument. Should be changed to "file_path"
  2. "MP3 and MP4 files are compatible, but will always convert to MP3."
    For mp4 you will also need to extract audio first with FFmpeg
  3. You need to split "input_file" to remove file format before you do this:
    f"{input_file}segment{i//segment_length + 1}.mp3", otherwise you will get somthing like that: audio.mp3_segment_1.mp3
    Need to add something like that: os.path.splitext(os.path.basename(file_path))[0]

@mgorkii-nlplogix mgorkii-nlplogix merged commit bea1274 into main Feb 28, 2025
5 checks passed
@mgorkii-nlplogix mgorkii-nlplogix deleted the cookbook-audio-split branch February 28, 2025 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants