Prerequisites
- You have activated the service and obtained and configured an API Key. Configure the API Key in environment variables instead of hard-coding it in your code, to prevent security risks caused by code leaks.
- Install the latest DashScope SDK.
QuickStart
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.