ACR云歌识别

ACRCloud song Recognize

嘿,我有来自 ACRCloud c# 演示的以下代码:

static void Main(string[] args)
{
    var config = new Dictionary<string, object>();

    config.Add("host", "us-west-2.api.acrcloud.com");
    config.Add("access_key", "key here....");
    config.Add("access_secret", "secret here...");
    config.Add("timeout", 10); // seconds

    ACRCloudRecognizer re = new ACRCloudRecognizer(config);

    // It will skip 0 seconds from the beginning of test.mp3.
    string result = re.RecognizeByFile("C:\temp\acrcloud_sdk_csharp-master\01Track01.mp3", 80);
    //string result2 = re.Recognize("C:\temp\acrcloud_sdk_csharp-master\01Track01", 80);
    Console.WriteLine(result);

    using (FileStream fs = new FileStream(@"C:\temp\acrcloud_sdk_csharp-masterTrack01.mp3", FileMode.Open))
    {
        using (BinaryReader reader = new BinaryReader(fs))
        {
            byte[] datas = reader.ReadBytes((int)fs.Length);
            // It will skip 0 seconds from the beginning of datas.
            result = re.RecognizeByFileBuffer(datas, datas.Length, 80);
            Console.WriteLine(result);
        }
    }

    Console.ReadLine();
}

对于两个 结果 我得到 return 的:

{"status":{
    "msg":"No result",
    "code":1001,
    "version":"1.0"
}}

不确定我做错了什么....任何帮助都会很棒!

我检查了你创建的项目问题是你将自己的存储桶附加到这个项目但是你没有上传任何文件到这个存储桶,换句话说:你的数据库是空的,这就是你无法识别的原因任何事物。如果您想识别音乐,请参考 this tutorial 并将 "ACRCloud Music" 存储桶附加到您的项目中,然后您应该能够识别音乐。