Browse SDKs · uni-app / uni-app x
SDKsuni-appEnterprise

Check audio transcription availability

OpenIM uni-app / uni-app x SDK guide for Check audio transcription availability.

Copy
import { getSpeechToTextCapabilities } from '@/uni_modules/unix-openim-sdk'

const capabilities = await getSpeechToTextCapabilities()

This is a Commercial capability query. The Promise resolves to OpenIMSpeechToTextCapabilitiesResult | null:

FieldTypeDescription
formatstring[] or nullSupported audio formats.
sampleRateHznumber[] or nullSupported sample rates in hertz.
maxRecordTimeMsnumber or nullMaximum recording duration in milliseconds.
maxFileSizenumber or nullMaximum file size in bytes.
providerstring or nullCurrent speech-recognition provider.
requestTypestring or nullRequest type required by the service.
crossDomainboolean or nullWhether cross-domain processing is allowed.

Query and cache capabilities for the current login session before displaying transcription UI. Validate format, sample rate, duration, and size before sending audio. Capabilities can vary by service, language, and account, so refresh them after login changes. Disable transcription on failure instead of guessing limits. This query does not emit message events.