Spokestack provides an extensible speech recognition pipeline for the iOS platform. It includes a variety of built-in speech processors for Voice Activity Detection (VAD), wakeword activation, and Automatic Speech Recognition (ASR).
Table of Contents
- Voice activity detection
- Wakeword activation with two different implementations
- Simplified Automated Speech Recognition interface
- Speech pipeline seamlessly integrates VAD-triggered wakeword detection using on-device machine learning models with transcribing utterances using platform Automated Speech Recognition
- On-device Natural Language Understanding utterance classifier
- Simple Text to Speech API
CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate Spokestack into your Xcode project using CocoaPods, specify it in your Podfile:
Configure Wakeword-activated Automated Speech Recognition
import Spokestack // assume that self implements the SpeechEventListener and PipelineDelegate protocols let pipeline = SpeechPipelineBuilder() .addListener(self) .setDelegateDispatchQueue(DispatchQueue.main) .useProfile(.appleWakewordAppleSpeech) .setProperty("tracing", ".DEBUG") pipeline.start()
This example creates a speech recognition pipeline using a wakeword detector that is triggered by VAD, which in turn activates an ASR, returning the resulting utterance to the
SpeechEventListener observer (
self in this example).
Text to Speech
// assume that self implements the TextToSpeechDelegate protocol let tts = TextToSpeech(self, configuration: SpeechConfiguration()) tts.speak(TextToSpeechInput("My god, it's full of stars!"))
Natural Language Understanding
// assume that self implements the NLUDelegate protocol let nlu = try! NLUTensorflow(self, configuration: configuration) nlu.classify(utterance: "I can't turn that light in the room on for you, Dave", context: [:])
A build error similar to
Code Sign error: No unexpired provisioning profiles found that contain any of the keychain's signing certificates will occur if the bundle identifier is not changed from
io.Spokestack.SpokestackFrameworkExample, which is tied to the Spokestack organization.
SpokestackFrameworkExample project is a reference implementations for how to use the Spokestack library, along with runnable examples of the VAD, wakeword, ASR, NLU, and TTS components. Each component has a button on the main screen, and can be started, stopped, predicted, or synthesized as appropriate. The component screens have full debug tracing enabled, so the system control logic and debug events will appear in the XCode console.
Getting Started, Cookbooks, and Conceptual Guides
API reference is available on Github.
- Ensure that
git lfshas been installed: https://git-lfs.github.com/. This is used to manage the storage of the large model and metadata files in
- Ensure that CocoaPods has been installed:
gem install cocoapods(not via
- Ensure that you are registered in CocoaPods:
pod trunk register YOUR_EMAIL --description='release YOUR_PODSPEC_VERSION'
- Increment the
pod lib lint --use-libraries --allow-warnings, which should pass all checks
git commit -a -m 'YOUR_COMMIT_MESSAGE' && git tag YOUR_PODSPEC_VERSION && git push --origin
pod trunk push --use-libraries --allow-warnings
Copyright 2020 Spokestack, Inc.
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.