The right way to Break up Audio Report into Smaller Chunks on Your Mac

by | Apr 20, 2023 | Etcetera | 0 comments

Have you ever ever ever had a chronic audio document that you just wanted to damage down into smaller, further manageable pieces? If so, you’re in excellent fortune because it’s if truth be told a lovely easy procedure!

In this article, I’m going to show you the way you’ll be able to use a simple bash script on your Mac to split your audio document into numerous smaller information, every spherical 8-10 minutes long, or basically any duration you need. So let’s get started!

split large audio file

Prerequisite

To get this to art work, your Mac will need the ones two portions installed, Homebrew and FFmpeg.

How to Arrange Homebrew

Arrange Homebrew for many who haven’t already; you’ll do this via opening a Terminal window and entering the following command:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/arrange/HEAD/arrange.sh)"
How to Arrange FFmpeg

Once Homebrew is installed, run the following command to place in FFmpeg:

brew arrange ffmpeg

Wait for the set as much as end, which it’ll take a while, and FFmpeg it will be ready to use.

Splitting an Audio Record into Smaller Chunks

With every Homebrew and FFmpeg installed, we nowadays are ready to split the massive audio document into smaller pieces.

See also  5 Very best Internet Design Companies to Rent (Up to date)
Step 1.

Open your favorite code editor, paste the following bash script into it, and save it as ‘splitaudio.sh‘.

#!/bin/bash

# Define the path to the input MP3 document
input_file="document.mp3"

# Define the duration of every bite in seconds (480 seconds = 8 minutes)
chunk_length=480

# Create an output list to store the chunks
mkdir -p output

# Use ffmpeg to split the MP3 document into chunks
ffmpeg -i "$input_file" -f segment -segment_time "$chunk_length" -c reproduction "output/chunk_percent03d.mp3"
Step 2.

Trade document.mp3 in input_file="document.mp3" with the determine of your audio document.

Examples:

Filename is ‘meeting.mp3
input_file="meeting.mp4"
Filename is ‘meeting.mp3‘, inside ‘audio‘ folder
input_file="audio/meeting.mp4"

Chunk_length decides how long every output audio document should be, in seconds. If you want to have them to be 10 minutes every, then your chunk_length should be 600.

The overall line throughout the code determines where every bite of the audio document it will be saved, and its document naming prefix.


ffmpeg -i "$input_file" -f segment -segment_time "$chunk_length" -c reproduction "output/chunk_percent03d.mp3".

In our code, the output filename construction output/chunk_percent03d.mp3, which is in a position to save every bite throughout the ‘output‘ list with a filename of chunk_001.mp3, chunk_002.mp3, and so on.

Step 3.

Ensure that each one changes in ‘splitaudio.sh‘ is saved, for many who haven’t already. Next, we will need to make it executable.

In Terminal, type throughout the following command and hit Enter.

chmod +x splitaudio.sh
Step 4.

In spite of everything, run the bash script with the following command:

/splitaudio.sh

That’s it. You’ll have your audio document reduce up into smaller chunks, and saved right through the output folder.

See also  Download a FREE Blog Post Template for Divi’s Poke Restaurant Layout Pack
final result

FAQ:

1. How to uninstall Homebrew?
  1. Open the Terminal app on your Mac.
  2. Type the following command and hit Enter:
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/arrange/HEAD/uninstall.sh)"
  3. Practice the turns on to uninstall Homebrew. You’ll be asked to enter your password.
  4. As quickly because the uninstallation process is complete, you’ll test that Homebrew has been uninstalled via typing the following command throughout the Terminal and hitting Enter:
    brew --version

If Homebrew has been uninstalled successfully, you’ll have to see a “command now not came upon” error message.

2. How to uninstall FFmpeg?

Open the Terminal app on your Mac and type throughout the following command.

brew uninstall ffmpeg

Practice the suggested to complete the uninstallation process.

The submit The right way to Break up Audio Report into Smaller Chunks on Your Mac seemed first on Hongkiat.

WordPress Website Development

Supply: https://www.hongkiat.com/blog/split-large-audio-mac/

[ continue ]

WordPress Maintenance Plans | WordPress Hosting

Contents

See also  How one can Correctly Set Up the TikTok Advert Pixel in WordPress

read more

0 Comments

Submit a Comment

DON'T LET YOUR WEBSITE GET DESTROYED BY HACKERS!

Get your FREE copy of our Cyber Security for WordPress® whitepaper.

You'll also get exclusive access to discounts that are only found at the bottom of our WP CyberSec whitepaper.

You have Successfully Subscribed!