Qwen-Audio-ASR-Filetrans C# SDK
Use the C# SDK to transcribe audio files with Qwen-Audio-ASR-Filetrans and retrieve the results.
Quick start
Follow SDK overview to install the SDK and configure your API key. Replace WorkspaceId in the example endpoint with your workspace ID from the same region.
This example transcribes an audio file with qwen-audio-3.1-asr-flash-filetrans and prints the text.
using DashScope.Transcription;
using var client = new FunAsrFileTranscriber(new FileTranscriberOptions
{
Url = "https://WorkspaceId.cn-beijing.maas.aliyuncs.com/api/v1/services/audio/asr/transcription",
});
var request = new FileTranscriptionRequest
{
Model = "qwen-audio-3.1-asr-flash-filetrans",
FileUrls = ["https://dashscope.oss-cn-beijing.aliyuncs.com/samples/audio/paraformer/hello_world_female2.wav"],
};
var results = await client.TranscribeAsync(request);
foreach (var result in results)
foreach (var channel in result.Transcription.Transcripts)
Console.WriteLine(channel.Text);
Call workflow
In the quick start, TranscribeAsync submits the task, waits for completion, and downloads the results. To obtain the task ID first, use these steps:
- Create a
FunAsrFileTranscriberand setFileTranscriberOptions.Urlto your workspace transcription endpoint. - Create a
FileTranscriptionRequestand setModeltoqwen-audio-3.1-asr-flash-filetrans. Pass one publicly accessible HTTP(S) audio URL inFileUrls. Each request accepts only one URL. - Call
SubmitAsyncand save the returnedTaskId. - Call
WaitForCompletionAsyncto wait for completion, orQueryAsyncto check the status once. - Check
SubtaskStatusfor each entry inResults. For each successful subtask, pass itsTranscriptionUrltoDownloadTranscriptionAsyncand read the text fromTranscripts.
For methods and result objects, see Methods and events.
Request parameters
The table lists the FileTranscriptionRequest properties supported by this model family. Defaults are the initial SDK property values. For protocol fields, see HTTP API.
| Parameter | Type | Default | Description |
|---|---|---|---|
|
|
| Model ID. |
|
|
| Required. List of publicly accessible HTTP(S) URLs for the audio to transcribe. NoteEach request accepts only one URL. |
|
|
| ID of a precompiled vocabulary that can be reused across requests. NoteFor regional availability, see Supported models and regions. |
|
|
| Instant hotwords, specified as a map from hotword text to integer weight. NoteUse weights of 1–5 for regular hotwords or 50 for super hotwords. You can specify up to 50 super hotwords. When you also specify a precompiled vocabulary, the service merges both sets. If the total exceeds 2,000, it selects 2,000 hotwords at random. For regional availability, see Supported models and regions. |
|
|
| Zero-based indices of the audio tracks to transcribe. If omitted, only the first track is processed. NoteEach selected track is billed separately. |
|
|
| Sensitive-word filter rules as a JSON string. Replace matching words with the same number of asterisks or remove them. |
|
|
| Enables speaker diarization. Off by default. NoteOnly mono audio is supported. When diarization is enabled, audio of up to two hours is recommended. |
|
|
| Expected number of speakers. If omitted, the service detects the number automatically. NoteApplies only when |
|
|
| Language hints for recognition, for example NoteOnly the first four values take effect. |
|
|
| Set to NoteApplies only to |
|
|
| Set NotePut each user message before the corresponding assistant message. Only the five most recent messages of each type are retained, with up to 400 characters of text per turn. |
|
|
| Pass additional parameters as a JSON object serialized to a string. The SDK merges its fields into the request’s |