我正在开发一款iPad应用程序.我想在其中集成SIRI功能.
所以,请指导我研究这个问题.其实我不知道如何开始.
谢谢,
CP
任何人都可以帮我提供一个示例代码,用于在Apple Watchkit应用程序中添加Speech to Text转换功能.
在我的应用程序中,我希望能够告诉Siri:
所以我启用了Siri功能,添加了一个目标,实现了INStartWorkoutIntentHandling
(以及其他)委托方法,一切正常.
我现在可以说Start a workout with MyAppName
.PERFEKT!
现在我想告诉她类似Start an activity using MyAppName
甚至是什么Start a hike using MyAppName
.
所以我去了,并添加了AppIntentVocabulary.plist
这样的东西:
那里的快速问题......词汇项目标识符...如果工作 - 远足fe应该用于开始,结束,暂停,恢复,取消...标识符是否应该对所有人都相同?
现在我面临三个问题.
1.我可以告诉Siri的Start a hike
,它会工作,她会问我,我应该使用哪个应用.我告诉她Start a hike using MyApp
,她会告诉我她在Apple Music上找不到它?!?我勒个去?
2.如果我将单词添加Activity
到我的词汇表中,她将只打开iOS活动应用程序...永远不会问我是否可能要打开我的应用程序.
3.在提交我得到漏字的警告一样的一拳No example phrase was provided for INStartWorkoutIntent in the "en" language
,我也有!要么Sample phrase "Start a Hike using MyAppName" was not classified as a INStartWorkoutIntent intent
如果有人能向我展示一个AppIntentVocabulary.plist
与siri和iTunes Connect配合使用的文件的有效样本,我将非常高兴!
我正在开发一个锻炼应用程序,并希望将SiriKit集成到iOS 10中.我已经知道如何集成SiriKit并让Siri与我们的应用程序一起工作.
我能找到的唯一有用的资源是Apple的官方文档:SiriKit iOS 10
为了让Siri认出我们的自定义词汇,我们必须添加此文件 AppIntentVocabulary.plist
但是intent.workoutName.identifier
总是返回口头短语而不是VixelItemIdentifier,而不是有氧运动,而不是有氧运动.
是否有人面临此问题或找到任何解决方案?
我有一些麻烦为Siri添加自定义词汇.
我在我的应用程序中实现了Siri,它适用于经典命令.但是,我试图添加一个自定义短语,但它无法识别它.我尝试了" https://developer.apple.com/library/content/documentation/Intents/Conceptual/SiriIntegrationGuide/SpecifyingCustomVocabulary.html#//apple_ref/doc/uid/TP40016875-CH6-SW1 "中描述的两种方式,然后按照所有步骤.
你有其他任何提示或解释吗?或者你能告诉我如何调试这个,因为我不知道发生了什么,如果我的AppIntentVocabulary.plist被考虑在内或不是例如.
我已通过此appcoda 教程将语音集成到文本中 。我面临的问题是我希望用户可以自己编写/编辑某些内容,但是 SFSpeechAudioBufferRecognitionRequest 没有考虑用户输入的内容。
在 SFSpeechAudioBufferRecognitionRequest 中发送用户键入的输入的方式是什么,或者在发送新请求之前清除 SFSpeechAudioBufferRecognitionRequest 输入参数的任何方式。
提前致谢。
我正在开发Sirikit的应用程序.使用Sirikit,我已经显示了一个项目列表作为INTask,当我选择原始应用程序将打开的任何项目时,我已经实现了这一点.我的实际要求是我需要确定用户从Sirikit中选择的项目,我需要为不同的项目打开不同的ViewControllers.谁能帮我?先感谢您.任何帮助赞赏.
我dynamic
从意图定义中设置了一个意图参数。
假设我获取此选项信息的服务器当前已关闭。
目前尚不清楚如何向用户呈现无法检索的选项。我们应该返回选项的完成字段也接受Error
. 我已经用 的子类填充它,Error
并且我还实现了LocalizedError
这个类的协议......但是当我遇到来自快捷方式应用程序的错误时,Apple 只是显示一个弹出消息,该消息返回一条未本地化的可怕消息(但这包括正确的错误名称)。
这是我正在使用的代码...
func provideCarModelOptions(for intent: CarIntent, with completion: @escaping ([String]?, Error?) -> Void) {
if(somethingGoesWrongWithServers()){
completion([],CarError.ServerDown)
}else{
completion(ReturnListOfModels(), nil)
}
}
Run Code Online (Sandbox Code Playgroud)
这就是我实现CarError
枚举的方式
public enum CarError:Error{
case serverDown
case generic
}
extension CarError : LocalizedError{
public var errorDescription: String? {
switch self {
case .serverDown:
return "Server is down"
case .generic:
return "SomethingGoesWrong"
}
}
}
Run Code Online (Sandbox Code Playgroud)
我做错了什么还是苹果没有以正确的方式处理错误?
我希望能够测试哪些文本转语音可供我的 iOS 应用程序与 AVSpeechSynthesis 一起使用。生成已安装声音的列表很容易,但 Apple 将其中一些设置为禁止应用程序使用,我想知道哪些。
例如,考虑以下测试代码 (swift 5.1):
import AVFoundation
...
func voiceTest() {
let speechSynthesizer = AVSpeechSynthesizer()
let voices = AVSpeechSynthesisVoice.speechVoices()
for voice in voices where voice.language == "en-US" {
print("\(voice.language) - \(voice.name) - \(voice.quality.rawValue) [\(voice.identifier)]")
let phrase = "The voice you're now listening to is the one called \(voice.name)."
let utterance = AVSpeechUtterance(string: phrase)
utterance.voice = voice
speechSynthesizer.speak(utterance)
}
}
Run Code Online (Sandbox Code Playgroud)
当我打电话时voiceTest()
,控制台输出是这样的:
en-US - Nicky (Enhanced) - 2 [com.apple.ttsbundle.siri_female_en-US_premium]
en-US - Aaron - 1 [com.apple.ttsbundle.siri_male_en-US_compact] …
Run Code Online (Sandbox Code Playgroud) 我希望能够通过 Siri 说“使用 Next 应用程序呼叫 Emily”来触发 VoIP 呼叫,而无需添加快捷方式。
Emily 是我添加到我的联系人中的联系人,其中包含我自己的电话号码。我在日常司机手机上测试了示例应用程序,因此它有一张用于通话的 SIM 卡。
我在你的通讯录中没有看到“Emily”。
我没有看到这样的应用程序。您需要下载一个。搜索应用商店
请注意,如果您在更改显示名称时遇到问题。选择项目,更改显示名称,然后单击项目之外的位置(任何文件)并再次选择项目。运行应用程序,名称应该会更新。
这是代码。如果我的显示名称是下一个,它适用于“使用下一个应用程序呼叫艾米丽”。如果我的显示名称是 Dog,它也适用于“使用 Dog 应用程序呼叫 Emily”。
该示例应用程序是用 SwiftUI 代码编写的,只需进行最少的设置即可测试 Siri 功能。
TestSiriSimple -> TestSiriSimpleIntents -> IntentHandler:
import Intents
class IntentHandler: INExtension {
override func handler(for intent: …
Run Code Online (Sandbox Code Playgroud)