LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-21-2016, 12:38 AM   #1
dexfcoss
LQ Newbie
 
Registered: Apr 2016
Posts: 13

Rep: Reputation: Disabled
silence detection of mp3 file


Hi everyone.
I am now using vlc to do the audio streaming and would like to add silence detection function.
I planned to use Streamripper to record audio streaming and save as mp3 format to haddisk every 10 seconds.
Then run a script to check each mp3 file have silence or not. If it have silence around 5 seconds it will send a alert to us.
Does any software can detect the silence of mp3 file? I am using Centos 6.7 text mode.
Thank you very much!

Kelvin

Last edited by dexfcoss; 04-21-2016 at 12:40 AM.
 
Old 04-21-2016, 01:35 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 18,398
Blog Entries: 12

Rep: Reputation: 5621Reputation: 5621Reputation: 5621Reputation: 5621Reputation: 5621Reputation: 5621Reputation: 5621Reputation: 5621Reputation: 5621Reputation: 5621Reputation: 5621
dexfcoss, your post is missing a lot of crucial information.
you should provide us with something to work with, if you want help.
please read the first link in my signature.

additionally, i think the question can be answered with a simple search?
 
Old 04-21-2016, 06:46 AM   #3
dexfcoss
LQ Newbie
 
Registered: Apr 2016
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
dexfcoss, your post is missing a lot of crucial information.
you should provide us with something to work with, if you want help.
please read the first link in my signature.

additionally, i think the question can be answered with a simple search?
Hi ondoho,
I am sorry for missing crucial information.i am now using linux centos 6.7 32bit text only, VLC version 1.1.13 and Streamripper 1.64.6.
The ideal flow chart should be:
VLC streaming ---> record by Streamripper via internet and save as mp3 file every 10 seconds ---> use software to detect threshold from saved mp3 ---> send email if threshold too low around 5 seconds
After some research from internet before, I tried jacksilent, sox, ffmpeg etc. But still cannot figure out how can detect audio threshold from mp3.
Sorry if any misunderstanding caused. Thanks

Kelvin
 
Old 04-21-2016, 09:18 AM   #4
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,387

Rep: Reputation: 407Reputation: 407Reputation: 407Reputation: 407Reputation: 407
Hi

I used mp3splt some time ago after recording some vinyl records. The "silence detection" actually worked on studio albums - splitting the sound into songs. It has lots of options. Read the man page - I think the file "mp3splt.log" will have silence information after using the -s option.

It is a package ready to install in Debian, I don't know about CentOS.
 
Old 04-22-2016, 02:02 AM   #5
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 18,398
Blog Entries: 12

Rep: Reputation: 5621Reputation: 5621Reputation: 5621Reputation: 5621Reputation: 5621Reputation: 5621Reputation: 5621Reputation: 5621Reputation: 5621Reputation: 5621Reputation: 5621
so there's a dedicated app that can detect silence.
i'm sure e.g. sox could do the same...
then you still have to write yourself a script around that, a script that does what you want.
show some effort, then we'll be willing to assist you further.
 
Old 04-22-2016, 05:49 AM   #6
dexfcoss
LQ Newbie
 
Registered: Apr 2016
Posts: 13

Original Poster
Rep: Reputation: Disabled
Thanks Guttorm and ondoho.
After tried sox and mp3splt more deeply. I find that sox and mp3splt can only open noise only mp3 file. If i try to open audio mp3, it will display the following error:

SOX

[root@localhost ~]# /usr/local/sox/bin/sox audio1.mp3 audio6.mp3 silence 1 5 1%

/usr/local/sox/bin/sox WARN mp3-util: MAD lost sync
/usr/local/sox/bin/sox WARN mp3-util: MAD lost sync
/usr/local/sox/bin/sox WARN mp3-util: recoverable MAD error
/usr/local/sox/bin/sox WARN mp3-util: MAD lost sync
/usr/local/sox/bin/sox WARN mp3-util: MAD lost sync
/usr/local/sox/bin/sox WARN mp3-util: MAD lost sync
/usr/local/sox/bin/sox WARN mp3-util: MAD lost sync
/usr/local/sox/bin/sox WARN mp3-util: recoverable MAD error
/usr/local/sox/bin/sox WARN mp3-util: recoverable MAD error
/usr/local/sox/bin/sox WARN mp3-util: recoverable MAD error
/usr/local/sox/bin/sox WARN mp3-util: MAD lost sync
/usr/local/sox/bin/sox WARN mp3-util: MAD lost sync
/usr/local/sox/bin/sox WARN mp3-util: recoverable MAD error
/usr/local/sox/bin/sox WARN mp3-util: recoverable MAD error
/usr/local/sox/bin/sox WARN mp3-util: recoverable MAD error
/usr/local/sox/bin/sox WARN mp3-util: MAD lost sync
/usr/local/sox/bin/sox WARN mp3-util: MAD lost sync
/usr/local/sox/bin/sox WARN mp3-util: MAD lost sync
/usr/local/sox/bin/sox WARN mp3-util: MAD lost sync
/usr/local/sox/bin/sox WARN mp3-util: MAD lost sync
/usr/local/sox/bin/sox WARN mp3-util: MAD lost sync
/usr/local/sox/bin/sox WARN mp3-util: recoverable MAD error
/usr/local/sox/bin/sox WARN mp3-util: MAD lost sync
/usr/local/sox/bin/sox WARN mp3-util: MAD lost sync
/usr/local/sox/bin/sox WARN mp3-util: MAD lost sync
/usr/local/sox/bin/sox WARN mp3-util: MAD lost sync
/usr/local/sox/bin/sox WARN mp3-util: MAD lost sync
/usr/local/sox/bin/sox WARN mp3-util: MAD lost sync
/usr/local/sox/bin/sox WARN mp3-util: MAD lost sync
/usr/local/sox/bin/sox WARN mp3-util: MAD lost sync
/usr/local/sox/bin/sox WARN mp3-util: MAD lost sync
/usr/local/sox/bin/sox WARN mp3-util: recoverable MAD error
/usr/local/sox/bin/sox WARN mp3-util: MAD lost sync
/usr/local/sox/bin/sox WARN mp3-util: MAD lost sync
/usr/local/sox/bin/sox WARN mp3-util: recoverable MAD error
/usr/local/sox/bin/sox WARN mp3-util: recoverable MAD error
/usr/local/sox/bin/sox WARN mp3-util: recoverable MAD error
/usr/local/sox/bin/sox WARN mp3-util: MAD lost sync
/usr/local/sox/bin/sox WARN mp3-util: recoverable MAD error
/usr/local/sox/bin/sox WARN mp3-util: recoverable MAD error
/usr/local/sox/bin/sox WARN mp3-util: recoverable MAD error
/usr/local/sox/bin/sox WARN mp3-util: recoverable MAD error
/usr/local/sox/bin/sox WARN mp3-util: MAD lost sync
/usr/local/sox/bin/sox WARN mp3-util: MAD lost sync
/usr/local/sox/bin/sox WARN mp3-util: MAD lost sync
/usr/local/sox/bin/sox WARN mp3-util: MAD lost sync
/usr/local/sox/bin/sox WARN mp3-util: MAD lost sync
/usr/local/sox/bin/sox WARN mp3-util: recoverable MAD error
/usr/local/sox/bin/sox WARN mp3-util: recoverable MAD error
/usr/local/sox/bin/sox WARN mp3-util: MAD lost sync
/usr/local/sox/bin/sox WARN mp3-util: recoverable MAD error
/usr/local/sox/bin/sox WARN mp3-util: MAD lost sync
/usr/local/sox/bin/sox WARN mp3-util: MAD lost sync
/usr/local/sox/bin/sox FAIL formats: can't open input file `audio1.mp3':

Mp3splt

[root@localhost ~]# mp3splt -s audio1.mp3
Processing file 'audio1.mp3' ...
error: no plugin matches the file 'audio1.mp3'

Here is my sox and mp3splt version:
mp3splt 2.4.2 (13/05/12) - using libmp3splt 0.7.2
SoX v14.4.2

I already activated mp3 feature when compiling sox. Thanks.
 
Old 04-22-2016, 07:00 AM   #7
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,387

Rep: Reputation: 407Reputation: 407Reputation: 407Reputation: 407Reputation: 407
Hi

If you google "mp3splt error: no plugin matches the file" you'll find some answers. It seems to be a problem with some old versions and RPM packages.
 
Old 04-22-2016, 02:22 PM   #8
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 18,398
Blog Entries: 12

Rep: Reputation: 5621Reputation: 5621Reputation: 5621Reputation: 5621Reputation: 5621Reputation: 5621Reputation: 5621Reputation: 5621Reputation: 5621Reputation: 5621Reputation: 5621
what distro?
is it up-to-date (have you updated/graded today)?
where is the input file coming from? is it really mp3?
why are you doing this as root?
 
Old 04-26-2016, 04:15 AM   #9
dexfcoss
LQ Newbie
 
Registered: Apr 2016
Posts: 13

Original Poster
Rep: Reputation: Disabled
I am now solve the problem. I tried to use ffmpeg change mp3 to ogg and then mp3splt work normally.
Now i can check the average audio level every 15 seconds. Thanks Guttorm and ondoho.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Bash script to set title of MP3 file equal to name of MP3 file jwbales Linux - General 7 09-15-2013 10:20 PM
Audio Silence Detection ctkroeker Linux - General 10 11-16-2012 12:16 PM
Recording Audio with Silence Detection? devmoc Linux - Software 4 09-25-2009 12:41 PM
File Detection Daemon? michael.barnes Linux - Server 2 08-17-2007 12:30 PM
How to play a media file/ video file/mp3 file recorded in harddisk/cd-rom arindam Linux - Newbie 2 09-05-2003 11:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:34 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