1

The problem I am looking at is almost completely identical to a text diff problem. I want to see the smallest amount of insertions and deletions which would transform one audio track to another. I have not been able to research a lot since I am very new to this entire area of programming (audio).

I found this thread: Is there a 'diff tool' for audio? But it does not contain any answers. I am willing to code a fair bit of it myself as long as someone can point me in the direction of "pieces" which I could use to adapt a text diff algorithm (given a piece of audio, find that same piece of audio in another audio track).

Ideally I'm looking for something that does the entire job, given two audio tracks, return a list of add and delete operations which turns track A into track B.

6
  • Could you describe your use-case a little more. The linked answer referrs to "synchronizing" changes in an audio file to changes in a video project. Today I would suggest doing that kind of changes in the video editor. My favourite Davinci Resolve has several tools for doing this and there would be no need to edit video and sound separately. But your use-case might be different, so please describe a litte more. (The reason for my question is because what you ask for might be quite complicated to achieve depending on selected solution).
    – ghellquist
    Commented Jul 25 at 18:06
  • @ghellquist Sure! So, I'm looking to create a sort of ad blocker for myself for podcasts. The idea hinges on targeted ads, if I download the podcast from two different IPs, I will get sections that differ and those are the ads. I'm looking for a way to extract this information and the problem struck me as similar to a text diff! Having some success with Dynamic Time Warping at the moment, but it feels like it's not quite a fit for the problem I'm trying to solve (deleted and re-posted as I messed up the mention and I am not sure if the ping goes out for an edit)
    – J. Kin
    Commented Jul 26 at 19:17
  • I think I worked out the answer to the building block I asked for in the initial post: "given a piece of audio, find that same piece of audio in another audio track". ChatGPT got me the idea of using Dynamic Time Warping, and while that was not an exact fit, DTW is computed from MFCC features. A sequence of MFCC coefficients can work somewhat like matching substrings, only one needs to use euclidian distance with a threshold for "sameness", as far as I understand - still experimenting but I am having very positive results. From this I should be able to build an algorithm for matching segments.
    – J. Kin
    Commented Jul 27 at 15:09
  • Hi J.Kin. That's a smart idea. If a little cumbersome in practice. Are you asking what are the building blocks of audio, or what block analysis (windowing) algorithms you can utilise? I'm a bit confused on the core question, because your comments seem different to the actual question, which seems to be about something that "turns track A into track B" using some type of comparison program. So what are you actually asking for? Algorithms and coding are off-topic, so I would need to migrate to dsp.
    – n00dles
    Commented Jul 27 at 19:29
  • @n00dles The "building block" I meant was the basic functionality I needed to be able to create an audio diff algorithm, that works similarly to text diff. To do something like that, I needed to be able to compare two pieces of audio to say if they are "the same audio" (I think this is what you mean by block analysis methods?) - which I accomplished using MFCC series. From there I can adapt a text diff algorithm for audio. I did not at all realize that DSP was off topic for this stack exchange, I am sorry about that. Won't happen again!
    – J. Kin
    Commented Jul 27 at 19:58

0

Browse other questions tagged or ask your own question.