Re: tone detection
Robert Jeffares <[email protected]> Sun, 30 May 2021 09:49:43 +1200
| Newsgroups | gmane.comp.audio.sox |
|---|---|
| Message-ID | <[email protected]> |
Hi Jan, this was working OK until we got to a point where the internet feed was about 2 minutes behind the source. It varies from about 10 seconds to as long as 3 minutes. The Innovonics 601 does not seem to have a buffer that big. I have accepted this as a vagary of the internet. On 30/05/21 4:48 am, Jan Stary wrote: > Please show your script that trims the leading audio > based on the silence effect. ## the audio is recorded as newsaudio.wav #record level is at -12 to allow plenty of headroom # heres a little eq sox newsaudio.wav eqednews.wav highpass 120 lowpass 5000 equalizer 2000 500 +1 #normalise track so we are working with reference audio sox -v `sox eqednews.wav -n stat -v 2>&1` newsaudio.wav normalised.wav #use sox to find out how long to first 2 second gap first trim the track #first find out how long from the start of the file to 2 sec silence #this will fail if there is an earlier 2 second gap. Minute before news is a trailer so unlikely # tweaked to 1.0 sec because presentation too slack and it looks like lead is added #upped modulation level of silence to allow for announcer breath < one in particular has a big intake of breath right before bulletin. Mic Open sox -V3 normalised.wav clipped.wav silence 0.5 0.1% 1.0 0.8% #increased floor level to 0.8 because of studio noise at -30 < air con and such not unusual #We need to know how long this is in seconds LENGTH=` sox clipped.wav -n stat 2>&1 | sed -n 's#^Length (seconds):[^0-9]*\([0-9.]*\)$#\1#p' ` #Cut that off the front of the audio sox -V3 normalised.wav head.wav trim $LENGTH >>/home/rd/$(hostname)-cleanupbbcnews.log # the bulletin is 5 minutes long so this will trim the bottom # This relies on a 1.8 second gap at the end of the bulletin now reduced to 1.2 because of switch noise. ## look for silence from end of file sox -V3 head.wav clapped.wav reverse silence 0.5 0.1% 1.0 0.8% reverse TAIL=` sox clapped.wav -n stat 2>&1 | sed -n 's#^Length (seconds):[^0-9]*\([0-9.]*\)$#\1#p' ` #increased floor level to 0.8 because of studio noise at -30 #Now cut that off the end of the audio sox -V3 head.wav allthenews.wav reverse trim $TAIL reverse # gone back to just cut at 5 min and 1.3 sec # this is a debug line #cp /head.wav /allthenews.wav # just in the meantime #sometimes that gap at the end is too short so this is the double check lops it at 5:01 the follow on is too tight sox -V3 allthenews.wav justthenews.wav trim 0 5:01 -- Robert Jeffares Communication Consultants 64 Warner Park Avenue Laingholm Auckland New Zealand 0604 +64 9 817 6358 _______________________________________________ Sox-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sox-users