An Azure service that integrates speech processing into apps and services.
Hi 凯旋 李,
It seems like you are encountering an issue with the Speech SDK on iOS where the error 0x15 (SPXERR_MIC_ERROR) appears when initiating voice translation. This error generally indicates that the application is unable to access the device’s microphone. On iOS, microphone access is controlled by the operating system, and if the app has not been granted permission or if another application is currently using the microphone, the Speech SDK will fail to start and report this error. It can also occur if the audio session is not properly initialized or activated before starting speech recognition.
To resolve this issue, first make sure that your app has the correct microphone permissions configured. This requires adding the NSMicrophoneUsageDescription key in your app’s Info.plist file with a message that clearly explains why microphone access is needed. If this key is missing, the operating system will block access to the microphone entirely. Also ensure that the microphone is not already in use by other apps or background processes at the time you start recognition, as simultaneous access conflicts can lead to the same error.
It is also recommended to implement error handling logic to catch cases where the microphone cannot be accessed. This allows your application to respond gracefully, for example by notifying the user and retrying initialization once the microphone becomes available again. Additionally, confirm that the Speech SDK is being initialized correctly according to the documentation, and that your AVAudioSession is configured with an appropriate category such as PlayAndRecord or Record and is activated before beginning speech recognition. Proper configuration of the audio session ensures that the SDK has exclusive access to the microphone when it starts recording.
By verifying microphone permissions, ensuring exclusive microphone access, handling initialization errors, and following the correct Speech SDK setup steps, you can significantly reduce or eliminate the occurrence of the SPXERR_MIC_ERROR when using voice translation on iOS.
For more information:
iOS use cases
Quickstart: Install the Speech SDK for Objective-C
SPXERR_AUDIO_SYS_LIBRARY_NOT_FOUND
Reference threads:
[https://learn.microsoft.com/en-us/answers/questions/2125092/how-to-fix-exception-with-an-error-code-0x15-(spxe](https://learn.microsoft.com/en-us/answers/questions/2125092/how-to-fix-exception-with-an-error-code-0x15-(spxe)
https://learn.microsoft.com/en-us/answers/questions/848838/unity-with-azure-speech-sdk-for-android-and-ios