LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-10-2021, 10:13 AM   #1
kzo81
Member
 
Registered: Aug 2014
Location: Hungary
Distribution: Debian, Linux Mint, CentOS
Posts: 197

Rep: Reputation: Disabled
ffmpeg or sox cut only speaches


Hi,

Do you think it is possible to cut out only the speeches from a long radio recording?
I got 1 hour recording but there are some 3-10 second human speech in them.
There is complete silence in between the speeches.
The filename should be 1 second before the speech starts. I was experimenting with ffmpeg and sox.

Thanks,

Zolee
 
Old 08-10-2021, 10:25 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by kzo81 View Post
I was experimenting with ffmpeg and sox.
Tell us more about that. Also what your web searches revealed.
I am pretty sure cutting silence is possible with at least one of those two, but I'd have to look it up for you to tell you exactly how.
 
Old 08-10-2021, 10:52 AM   #3
kzo81
Member
 
Registered: Aug 2014
Location: Hungary
Distribution: Debian, Linux Mint, CentOS
Posts: 197

Original Poster
Rep: Reputation: Disabled
for instance this:

sox infile.wav outfile.wav silence 1 1 5%

This should trim out the silence which is under 5% noise and 1 second before and after. But when I open the file with audacity its a mess.

or this:

sox infile.wav outfile.wav silence 1 1 5% 1 1 5% : newfile : restart

with the second I dont know how to change the file names to the original starting point

Last edited by kzo81; 08-10-2021 at 10:56 AM.
 
Old 08-10-2021, 10:56 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Play with the values?
Also, what's "a mess"?
The sox man page has some examples wrt 'silence', take a deeper look.
 
Old 08-10-2021, 11:06 AM   #5
kzo81
Member
 
Registered: Aug 2014
Location: Hungary
Distribution: Debian, Linux Mint, CentOS
Posts: 197

Original Poster
Rep: Reputation: Disabled
mess means in this context that compared to the original recording there the new trimmed recording has lost all qualities. Not even recognisable...
And I played with the values a lot.

Last edited by kzo81; 08-10-2021 at 11:07 AM.
 
Old 08-12-2021, 04:24 AM   #6
andrew.46
Senior Member
 
Registered: Oct 2007
Distribution: Slackware
Posts: 1,365

Rep: Reputation: 493Reputation: 493Reputation: 493Reputation: 493Reputation: 493
FFmpeg has a nice audio filter called 'silenceremove' that would be well worth looking at...
 
1 members found this post helpful.
Old 08-13-2021, 01:05 AM   #7
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
^ +1

Quote:
Originally Posted by kzo81 View Post
mess means in this context that compared to the original recording there the new trimmed recording has lost all qualities. Not even recognisable...
And I played with the values a lot.
So you mean it actually does what you want, but the result is of inferior sound quality? Why in dog's name didn't you mention that before? I'm sure sox has settings to avoid this; did you even glance at its man page?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Enabling support for ffmpeg 0.11 in sox-14.4.0 allend Slackware 1 11-11-2012 05:37 PM
sox package, Slackware 13.1, fails on sox 1.wav -e stat burbabro Slackware 1 05-04-2011 02:26 AM
help with cut command using find. Cut last 8 characters leaving the rest ncsuapex Programming 4 09-16-2009 08:55 PM
How to use command grep,cut,awk to cut a data from a file? hocheetiong Linux - Newbie 7 09-11-2008 07:16 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration