Use the C# SDK to transcribe audio files with Fun-ASR-Flash 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 fun-asr-flash-2026-06-15 and prints the text.
Call workflow
-
Create a
FunAsrFlashFileTranscriberand setFlashFileTranscriberOptions.Urlto your workspace endpoint. -
Create a
FlashTranscriptionRequestand setModeltofun-asr-flash-2026-06-15. SetAudioto a public URL, a data URI, or a local file path. MatchFormatto the input format. For raw PCM, setSampleRateto the actual sample rate. -
Call
TranscribeAsyncand read the complete transcript fromTextin the result. -
To receive results over SSE instead, call
TranscribeStreamingAsyncand read the results withawait foreach.Multiple updates are returned only for audio at least one minute long.
Request parameters
The table lists the FlashTranscriptionRequest properties supported by this model family. Defaults are the initial SDK property values. For protocol fields, see HTTP API.
| Parameter | Type | Default | Description |
|---|---|---|---|
Model | string | qwen-audio-3.1-asr-flash | Model ID. Set the model ID explicitly for this family, for example fun-asr-flash-2026-06-15. Otherwise, the SDK uses the default shown in the table. |
Audio | string | null | Required. A public audio URL, a Base64 data URI, or a local file path. For a local path, the SDK reads the file and converts it to a data URI. |
Format | string | wav | Input audio format, such as wav, mp3, or pcm. Set it to match the audio. |
SampleRate | int? | null | Audio sample rate in Hz. For raw PCM, set this property to the actual sample rate of the recording. |
VocabularyId | string? | null | ID of a precompiled vocabulary that can be reused across requests. For regional availability, see Supported models and regions. |
LanguageHints | IList<string>? | null | Language hints for recognition, for example ["zh"].If you specify multiple values, only the first takes effect. |
Context | IList<FlashContextMessage>? | null | Use FlashContextMessage.Role and FlashContextMessage.Text to set the role and text.Put 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. |
ExtraParametersJson | string? | null | Pass additional parameters as a JSON object serialized to a string. The SDK merges its fields into the request’s parameters object. Use only protocol fields supported by the model. |