Prerequisites
-
Obtain and configure an API Key. Do not hardcode long-term API Keys in mobile apps. We recommend that your app server generate a temporary API Key and then distribute it to the client.
-
Download the latest SDK integration package. After extracting it, copy
entry/libs/neonui.harto theentry/libsfolder of your app project, and add the dependency inentry/oh-package.json5:{ "dependencies": { "neonui": "file:libs/neonui.har" } }To integrate through HarmonyOS C++ interfaces, you can use the dynamic libraries in the
native/libsfolder and the header files in thenative/includefolder of the integration package. -
Declare the network and microphone permissions in your app's
module.json5, and request the microphone permission at runtime.reason_internetandreason_microphoneare example resource names; define the corresponding descriptions in your app 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" } } ]
QuickStart
Use DevEco Studio to open the sample project in the integration package. The sample page is located at entry/src/main/ets/pages/dashscope/DashFunAsrSpeechTranscriberPage.ets. Configure an API Key and you can run it.
Use model qwen-audio-3.1-asr-flash-message in the example.