首页 > 解决方案 > 为什么 Aurio 无法比较我的音轨?

问题描述

我正在为合唱团构建一个网站,以便在他们被邀请参加试镜之前自动评估候选人。我正在维护一个候选人应该唱歌的音频片段数据库。

我正在尝试从这里使用 Aurio 代码: https ://github.com/protyposis/Aurio 。但我无法让它正确比较速度较慢或不同比例的音轨。

private int findMatchesWang(String file1, String file2)
{
    // Setup the sources
    var audioTrack1 = new AudioTrack(new FileInfo(file1));
    var audioTrack2 = new AudioTrack(new FileInfo(file2));

    var profile = Aurio.Matching.Wang2003.FingerprintGenerator.GetProfiles()[0];
    var store = new Aurio.Matching.Wang2003.FingerprintStore(profile);
    var gen = new Aurio.Matching.Wang2003.FingerprintGenerator(profile);

    int hashCount = 0;

    gen.SubFingerprintsGenerated += delegate (object sender, SubFingerprintsGeneratedEventArgs e)
    {
        store.Add(e);
        hashCount += e.SubFingerprints.Count;
    };
    gen.Generate(audioTrack1);
    gen.Generate(audioTrack2);

    var matches = store.FindAllMatches();

    return matches.Count;
}

当 file1 与 file2 相同时,该函数返回预期值(4686 个匹配项)。我尝试使用以下方法调用该函数:

在这两种情况下,函数都返回 0。请在此处找到文件:https ://drive.google.com/drive/folders/10vKdc6C3InWpVs0g877Yub3ddv267GSZ?usp=sharing

任何人都可以解释什么是错的?

标签: c#audio-fingerprinting

解决方案


Aurio 中实现的算法并非旨在匹配具有不同速度或音高/比例的内容。它们只能处理这些维度中非常非常小的变化,例如由于回放和记录设备之间的采样时钟漂移而发生的变化(即,可测量,但人类听众无法察觉)。

(我是Aurio库的作者)


推荐阅读