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


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

Start by importing SwiftUISpeechToText

  1. import SwiftUISpeechToText

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:



View Github