首页 > 解决方案 > 如何在微软认知语音库中使用objective-c将OutputFormat.simple设置为OutputFormat.detailed?

问题描述

参考| https://docs.microsoft.com/en-us/objectivec/cognitive-services/speech/spxspeechconfiguration

目前在spxspeechconfigurationobjective-c中不包含任何setOutputFormat允许我们设置它的方法OutputFormat.detailed

我需要获取详细信息,因为当前 spxspeechconfiguration 的默认值OutputFormatOutputFormat.simple.

我在 Java for android 看到,它有这个方法 参考| https://docs.microsoft.com/en-us/java/api/com.microsoft.cognitiveservices.speech.speechconfig.setoutputformat?view=azure-java-stable#com_microsoft_cognitiveservices_speech_SpeechConfig_setOutputFormat_OutputFormat_

正如您在 java-android 方法的参考资料中看到的那样,它有setOutputFormat(),但objective-c 没有。

如何将其设置为OutputFormat.detailed使用objective-c?请指导我,谢谢。

标签: objective-cazure-cognitive-servicesmicrosoft-speech-platform

解决方案


SPXSpeechConfiguration *speechConfig = [[SPXSpeechConfiguration alloc] initWithSubscription:speechKey region:serviceRegion];

[speechConfig setPropertyTo:@"True" byId:SPXSpeechServiceResponseRequestDetailedResultTrueFalse];

经过反复试验,显然SPXSpeechServiceResponseRequestDetailedResultTrueFalse已经实现,因为它在将属性设置为True. 也许文档应该更改方法注释,its already implemented通过一些步骤来设置它,而不是not implemented yet.


推荐阅读