sox-users@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
From: Rafal Maszkowski <rzm@icm.edu.pl>
To: sox-users@lists.sourceforge.net
Subject: Re: Search and remove audio sections
Date: Thu, 19 Nov 2020 03:21:30 +0100	[thread overview]
Message-ID: <20201119022130.GL516@ukwial.icm.edu.pl> (raw)
In-Reply-To: <DB8P195MB0741A75BDDBFA908FCBBD407F3E20@DB8P195MB0741.EURP195.PROD.OUTLOOK.COM>

On Tue, Nov 17, 2020 at 03:52:52PM +0000, Dani wrote:
> I have a bunch of old MP3 podcasts that have ads in them, at the beginning and the end. These are short bits of podcasts (up to 10 minutes each), and the ads are quite distracting.
> The ads are about 30 seconds long and usually have a small familiar jingle before they start and after they end. 
> I was wondering if there is an ability using SoX (or other tool) to do a "search and remove" on these, in a batch format - that would apply to hundreds of these files.
> Something in the form of:
> %jingle% -> the familiar jingle at the start and end of the ad, so... mimicking a made-up wildcard/regex search:
> Search for:  (%jingle% * %jingle%) ( * ) (%jingle% * %jingle%)
> Replace: ($2) - meaning - I leave only the center part.
> Is that something that can be done with audio?

I am very interested in comparing recordings and in searching sound
samples in recordings. I managed to work quite a lot on this last year
and my work may be sufficient for my purposes but is unfinished and I
have not tried to use it since a year. So it is not a ready solution but
something you can try to work on and improve. It should not be very
difficult to fit it to your purposes but more work is needed to make it
universal.

How it works. I really miss MPEG-7 in sox. There are even no beginnings
of it there so I have used mpeg7ease ease program to extract audio
spectrum envelopes of sound (aselnb script) and my program to compare or
search extracts. 

Generating ASEs (FILE may be any sound or video file understandable by
ffmpeg, eventually we use audio only):
	aselnb FILE…

Then we can compare various ~/.ease/cache/*.ease files and get a
positive result and time shift between them or negative one:
	aselnbcmp -v -c "$name1" "$name2"
	aselnbcmp -v -c -P 16 -S 8 "$name1" "$name2"

… or search one in another:
	aselnbcmp -v -s ~/.ease/cache/needle.ease ~/.ease/cache/haystack.ease

The software I have used or have written may be found in:
ftp://ftp.icm.edu.pl/private/rzm/patches/ase/

R.
-- 
„Walczy on z całym zapamiętaniem przeciwko intelektowi” - z akt personalnych prof. A. Baeumlera


_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

  parent reply	other threads:[~2020-11-19  2:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-17 15:52 Search and remove audio sections Dani
2020-11-17 20:42 ` Jeremy Nicoll - ml sox users
2020-11-17 21:40   ` Jeff Learman
2020-11-18  0:25     ` Jeremy Nicoll - ml sox users
2020-11-18  8:01       ` Dani
2020-11-19  2:21 ` Rafal Maszkowski [this message]
2020-11-20 14:18 ` Jan Stary

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.sourceforge.net/lists/listinfo/sox-users

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201119022130.GL516@ukwial.icm.edu.pl \
    --to=sox-users@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/sox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).