Prerequisites
- The service is activated and Obtain an API key. To guard against security risks caused by code leaks, Configure API key as an environment variable, rather than hard-coding it in your code.
- Install the latest DashScope SDK.
Quick start
Replace {WorkspaceId} with your workspace ID and {YOUR_AUDIO_FILE} with the path to a local 16 kHz WAV file. The example prints the transcription in the terminal.