0

Hey all I have the following code from the ACRCloud c# demo:

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-master\01Track01.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();
}

For both results I am getting the return of:

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

Not sure what I am doing incorrect.... Any help would be great!

Gilad Green
  • 36,708
  • 7
  • 61
  • 95
StealthRT
  • 10,108
  • 40
  • 183
  • 342
  • im not sure what you are doing wrong, but maybe try using the sample code here? https://github.com/acrcloud/webapi_example/blob/master/identify%20protocol%201%20(recommended)/IdentifyProtocolV1.cs – rideon88 Aug 17 '16 at 17:38
  • That produces the same result. – StealthRT Aug 17 '16 at 18:09

1 Answers1

0

I checked the project you have created the problem is you attached your own bucket to this project but you didn't upload any files to this bucket, in other words: your database is empty, that's why you could not recognize anything. If you want to recognize music, please refer to this tutorial and attach "ACRCloud Music" bucket to your project then you should be able to recognize music.

Tony Li
  • 95
  • 5