Basic example showing how to identify a song from an audio URL.
This example assumes using AudD; is in scope and apiKey contains your AudD API key.
1 2 3 4 5 6 7 8 9101112
varapiToken=Environment.GetEnvironmentVariable("AUDD_API_TOKEN")is{Length:>0}tokenValue?tokenValue:Environment.GetEnvironmentVariable("AUDD_API_KEY")is{Length:>0}keyValue?keyValue:thrownewAssertInconclusiveException("AUDD_API_TOKEN environment variable is not found.");usingvarclient=newAudDClient(apiToken);// Recognize a short audio sample by URL. Additional providers such as// Apple Music or Spotify can be requested with the return parameter.varresponse=awaitclient.Recognition.RecognizeByUrlAsync(url:"https://audd.tech/example.mp3",@return:"apple_music,spotify");