Use the C# SDK to call Qwen-Omni-Realtime over WebSocket. The examples use audio input and return text and audio.
Prerequisites
Get an API key and set DASHSCOPE_API_KEY. Use an API key from the same region as your workspace.
Install the SDK
Download and extract Bailian.DashScope-1.1.0.zip. To use the SDK in a C# project, install it from the local NuGet source.
Quick start
- Create a .NET 10 console project and install the SDK as described above. Copy the complete C# example into
Program.cs. - Place
input.pcmin the project directory. Use 16 kHz, mono, 16-bit little-endian raw PCM. Convert WAV files to raw PCM first.
WorkspaceId with your workspace ID. For supported regions and endpoints, see WebSocket access.
This example uses qwen3.8-omni-flash-realtime with the Tina voice.
output.pcm.
API reference
See the C# SDK API reference for options, methods, and events. Call FinishAsync after the final ResponseCompleted event. The SDK chooses CloseOnly for Omni Realtime and ends the session by closing the connection.
To send image frames, use SendRawEventAsync to send complete events. For configuration, input formats, and event order, see Omni Realtime WebSocket access.