Skip to content

ACRCloud

Modern .NET SDK for ACRCloud generated from a locally maintained OpenAPI definition with AutoSDK.

Nuget package dotnet License: MIT Discord

Generated from the source spec

Built from a local OpenAPI definition derived from ACRCloud's public Identification API docs so the SDK stays close to the upstream API surface.

Auto-updated

Designed for fast regeneration and low-friction updates when the upstream API changes without breaking compatibility.

Modern .NET

Targets current .NET practices including nullability, trimming, NativeAOT awareness, and source-generated serialization.

Docs from examples

Examples stay in sync between the README, MkDocs site, and integration tests through the AutoSDK docs pipeline.

Usage

1
2
3
4
5
6
7
using ACRCloud;

using var client = new ACRCloudClient(host, accessKey, accessSecret);

var response = await client.IdentifyAudioAsync(
    sample: await File.ReadAllBytesAsync("sample.mp3"),
    sampleName: "sample.mp3");

Identify Audio

Basic example showing how to identify a local audio sample.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
var host =
    Environment.GetEnvironmentVariable("ACRCLOUD_HOST") is { Length: > 0 } hostValue
        ? hostValue
        : throw new AssertInconclusiveException("ACRCLOUD_HOST environment variable is not found.");

var accessKey =
    Environment.GetEnvironmentVariable("ACRCLOUD_ACCESS_KEY") is { Length: > 0 } accessKeyValue
        ? accessKeyValue
        : throw new AssertInconclusiveException("ACRCLOUD_ACCESS_KEY environment variable is not found.");

var accessSecret =
    Environment.GetEnvironmentVariable("ACRCLOUD_ACCESS_SECRET") is { Length: > 0 } accessSecretValue
        ? accessSecretValue
        : throw new AssertInconclusiveException("ACRCLOUD_ACCESS_SECRET environment variable is not found.");

using var client = new ACRCloudClient(host, accessKey, accessSecret);

var samplePath =
    Environment.GetEnvironmentVariable("ACRCLOUD_SAMPLE_PATH") is { Length: > 0 } value
        ? value
        : throw new AssertInconclusiveException("ACRCLOUD_SAMPLE_PATH environment variable is not found.");

// ACRCloud requires signed multipart requests. The SDK helper computes
// timestamp, signature, sample_bytes, and signature_version for you.
var sample = await File.ReadAllBytesAsync(samplePath);
var response = await client.IdentifyAudioAsync(
    sample: sample,
    sampleName: Path.GetFileName(samplePath));

Support

Bugs

Open an issue in tryAGI/ACRCloud.

Ideas and questions

Use GitHub Discussions for design questions and usage help.

Community

Join the tryAGI Discord for broader discussion across SDKs.

Acknowledgments

JetBrains logo

This project is supported by JetBrains through the Open Source Support Program.