GithubHelp home page GithubHelp logo

ezakw / voiceoperationsample Goto Github PK

View Code? Open in Web Editor NEW

This project forked from milanistadev/voiceoperationsample

0.0 0.0 0.0 31 KB

This app is a sample app that recognizes specific voice commands such as "make it red", "make it blue", "make it green", and "make it black" and change the background color of the view in the frame.

Swift 100.00%

voiceoperationsample's Introduction

VoiceOperationSample

This app is a sample app that recognizes specific voice commands such as
"make it red", "make it blue", "make it green", and "make it black" and
change the background color of the view in the frame.
Voice commands are only Japanese in this sample. So partial rewriting is required when using in English.

このアプリは、「赤にして」「青にして」「緑にして」「黒にして」などの特定の音声コマンドを認識して枠内のビューの背景色を変えるサンプルアプリです。

voice

開発環境

  • Xcode 13 以上
  • iOS 14 以上
  • SwiftUI

使い方

  1. 音声認識利用の許可
  2. 許可したら下部のボタンをタップして認識状態に
  3. 特定の音声コマンドを発話
  4. 背景色が変化し認識状態終了

コマンドリスト

変更する場合は enum の VoiceCommandType をいじります。

  • 赤にして
  • 青にして
  • 緑にして
  • 黒にして

技術

このアプリでは SFSpeechRecognizer を利用しています。
認識状態は 1分間の制限があり回数制限もあります。
認識状態が終了するとボタンが緑に戻り再度タップすることで認識状態になります。

SFSpeechRecognizer

連続認識

コメントアウトしていますが,認識状態終了後にすぐ認識状態にできます。
バッテリの減りやパフォーマンスに影響が出る可能性もあります。

変更点は,ボタンタップのトリガーではなく,画面遷移後にすぐ認識状態になります。
音声コマンド発話後一旦終了扱いにはなりますが認識状態に戻ります。
連続して発話することで都度背景色の変更が可能という感じです。

voice2

Contact

Please feel free to contact us if you find a bug or have any feedback.
Suggestions for adding functions and code corrections are also welcome.

let name = "Takuya Aso" 
let email = "milanista224" + "@" + "icloud.com"
let profession = "iOS Engineer"
let location = "Tokyo"

voiceoperationsample's People

Contributors

milanistadev avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.