Estimation of audio alignment relative to a given reference, using shift-invariant fingerprints of the spectrum.
import AudioAlignment
let sample = try AudioFingerprint(audioURL: URL(fileURLWithPath: "sample.m4a"))
let reference = try AudioFingerprint(audioURL: URL(fileURLWithPath: "reference.m4a"))
let timeOffset = try sample.align(with: reference).estimatedTimeOffset
To use this package in a SwiftPM project, add the following line to the dependencies in your Package.swift file:
.package(url: "https://github.com/YuAo/AudioAlignment.git", from: "1.0.0"),
Accelerate is used to boost performance.
For a one-minute audio, the fingerprint generation takes approximately 60ms on a 2019 Intel iMac with i5 processor (in release mode).
ranwsn/Audio_Snippets_Alignment
Endless Light
by Siddhartha Corsus