26

I was looking for software which is able to cut audio files into smaller pieces, for example I set seconds and miliseconds for beginning and end of cutting, and then I can save cut content as new file.

30

Audacity is capable of doing this.

About Audacity

Audacity is a free, easy-to-use and multilingual audio editor and recorder for Windows, Mac OS X, GNU/Linux and other operating systems. You can use Audacity to:

  • Record live audio.
  • Convert tapes and records into digital recordings or CDs.
  • Edit Ogg Vorbis, MP3, WAV or AIFF sound files.
  • Cut, copy, splice or mix sounds together.
  • Change the speed or pitch of a recording.
  • And more! See the complete list of features.

enter image description here

| improve this answer | |
  • Use sudo apt-get install audacity to install it quickly – parsecer Nov 4 at 4:15
16

avconv can do this.

Example:

avconv -i infile.m4a  -ss *pos* -t *duration* outfile.mp3

pos is start time in seconds

duration is play time in seconds

Install libav-tools to make it happen.


If you are not sure about the start and end times and want to listen to the segment before making it a new file, you should know that avplay takes many of the same arguments as avconv does.

Example:

avplay -ss 5030 -t 970 infile.m4a

If you don't want to do math in your head and also would not like to pull up a calculator, you can use the Hour:Minute:Second format instead. The example given above would then be:

avplay -ss 1:23:50 -t 00:16:10 infile.m4a

Also, keep in mind that if the pieces are not the final output (e.g. you are going to combine them), you might want to keep using the same format as that of the input file.

| improve this answer | |
  • 3
    libav-tools is not available with apt install or snap install. ubuntu 18.04 – Michael Fulton May 18 '18 at 23:05
4

Somehow for me, the following worked extremely well

sudo apt-get install mpgtx

Once this is done, change the current directory to the directory where input.mp3 is located and then run the following:

mpgsplit input.mp3 [hh:mm:ss-hh:mm:ss] -o output.mp3
| improve this answer | |
  • Does not work for me: range [00:00:00-01:42:55] results in invalid [-1-98799992] range - what is wrong? File is 3h long. – Aleksey Kontsevich Dec 17 '18 at 10:57
0

Another method using mplayer

mplayer -quiet \
sourcefile.mp4 -ao pcm:fast:file=output.wav \
-vc dummy -vo null -channels 2 \
-ss 1:00 -endpos 0:30

note that output file will start from 1:00 for a duration of 30 seconds.

-endpos here means duration.

| improve this answer | |
-1

i've never use this, but it looks great Lmms & manual wiki

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.