Qwen-Audio-ASR-Message HarmonyOS SDK

Updated at:

Prerequisites

  1. Obtain and configure an API key. Do not hardcode a long-lived API key in a mobile app. We recommend generating a temporary API key on your application server and sending it to the client.

  2. Download the latest SDK package. Extract the package, copy entry/libs/neonui.har to the entry/libs directory of your application, and add the dependency to entry/oh-package.json5:

    {
      "dependencies": {
        "neonui": "file:libs/neonui.har"
      }
    }
    

    For a HarmonyOS C++ integration, use the shared libraries in native/libs and the header files in native/include.

  3. Declare network and microphone permissions in the application module.json5 file, and request microphone permission at runtime. reason_internet and reason_microphone are example resource names. Define the corresponding descriptions in your application resources.

    "requestPermissions": [
      {
        "name": "ohos.permission.INTERNET",
        "reason": "$string:reason_internet",
        "usedScene": { "abilities": ["EntryAbility"], "when": "always" }
      },
      {
        "name": "ohos.permission.MICROPHONE",
        "reason": "$string:reason_microphone",
        "usedScene": { "abilities": ["EntryAbility"], "when": "always" }
      }
    ]
    

Quick start

Open the sample project from the SDK package in DevEco Studio. The sample page is entry/src/main/ets/pages/dashscope/DashFunAsrSpeechTranscriberPage.ets. Configure an API key and run the project.

Use model qwen-audio-3.1-asr-flash-message in the example.

Reference