Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

Finding the end of a looped playlist in a music file

Featured Replies

  • Author
  • Localization

aluigi, posted Sat Sep 18, 2021 8:16 am (66508)


Often on youtube there are videos of 4, 8, 10, or even more hours containing a certain amount of tracks in loop.
For example the original playlist is only 40 minutes but the video is 4 hour, so if you want to keep a local collection of these audio files you are going to waste lot of space for nothing and maybe you don't like to listen the same playlist again and again.

I needed a basic and simple solution without big software, anything bloat to compile, complicated API, and hours spent reading and searching a solution.

There is this simple tool from acousticid that creates audio fingerprints of any input audio file, it splits it in small chunks and spit out a 32bit number for each chunk.
https://github.com/acoustid/chromaprint
The tool needs ffmpeg in the system, it's open source, multiplatform, and has compiled releases for Windows too.

So I forced the tool to fingerprint the whole file (by default it only checks the first few seconds), dump the fingerprints in an array, and scans the array searching if the fingerprints at the beginning of the file are found later.

The tool is launched as: fpcalc.exe -length 0 -raw -json FILE

It's a super simple and basic solution, but it works well since I only got few false positives in over 200 files I tested.

I made a simple tool for doing the job and returning the number of seconds where the repeated fingerprint is found, it can even launch ffmpeg for automatically cutting the file (add -DCUTIT to gcc when compiling).

Hope it's useful.

acrdupfind.c

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.