Skip to content

A Swift Package which helps to implement Speech to Text functionality in SwiftUI

License

Notifications You must be signed in to change notification settings

pandashashwat97/SwiftUISpeechToText

Repository files navigation

SwiftUISpeechToText

A Swift Package which helps to implement Speech to Text functionality in SwiftUI

Import the package through SPM using: https://github.com/pandashashwat97/SwiftUISpeechToText.git

Usage

  1. Add two privacy properties into the info list of your SwiftUI Project image

Start by importing SwiftUISpeechToText

  1. import SwiftUISpeechToText

UPADTES FOR BEGINERS: After the above steps you can now directly create a state variable and call a predefined view with the latest update v1.0

image

You will get a text field with prdefined option to convert speech to text.


Create a StateObject

  1. @StateObject var speechRecognizer = SpeechRecognizer()

Start transcribing

  1. Call function: speechRecognizer.transcribe()

Stop transcribing

  1. Call function: speechRecognizer.stopTranscribing()

Converted Text

  1. Use speechRecognizer.transcript as the converted text string

For more details about implementation please import and checkout the below project: https://github.com/pandashashwat97/SwiftUISpeechToTextDemo

Final Implementation:

Final.Speech.To.Text.Implementation.MP4

About

A Swift Package which helps to implement Speech to Text functionality in SwiftUI

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages