AcoustID.Web.LookupService.GetAsync C# (CSharp) Метод

GetAsync() публичный Метод

Lookup a fingerprint using the AcoustID webservice.
public GetAsync ( string fingerprint, int duration ) : Task
fingerprint string The audio fingerprint.
duration int The total duration of the audio.
Результат Task
        public Task<LookupResponse> GetAsync(string fingerprint, int duration)
        {
            return GetAsync(fingerprint, duration, null);
        }

Same methods

LookupService::GetAsync ( string fingerprint, int duration, string meta ) : Task

Usage Example

Пример #1
0
        private void Lookup(string fingerprint, int duration)
        {

            btnFingerprint.IsEnabled = false;

            LookupService service = new LookupService();

            service.GetAsync((results, e) =>
            {
                btnOpen.IsEnabled = true;

                if (e != null)
                {
                    System.Windows.MessageBox.Show(e.Message, "Webservice error");
                    return;
                }

                if (results.Count == 0)
                {
                    if (String.IsNullOrEmpty(service.Error))
                    {
                        System.Windows.MessageBox.Show("No results for given fingerprint.");
                    }
                    else System.Windows.MessageBox.Show(service.Error, "Webservice error");

                    return;
                }

                foreach (var result in results)
                {
                    var li = new AcoustIdItem();
                    li.AcoustId = result.Id;
                    li.Score = result.Score.ToString();
                    li.Recordings = result.Recordings;

                    lvResults.Items.Add(li);

                }
            }, fingerprint, duration, new string[] { "recordings", "compress" });
        }
All Usage Examples Of AcoustID.Web.LookupService::GetAsync