0

I am working on Speech to Text Application in iOS.

Actually I already made it but my actual problem is when speech is converted in text how can I save the text file in txt in specified location?

koen
  • 5,383
  • 7
  • 50
  • 89
  • Hello! Does this answer your question? https://stackoverflow.com/questions/47329826/swift-how-to-convert-text-to-speech-generated-audio-to-mp3 –  Dec 18 '19 at 13:02
  • Your question is really about how to save a text file. So this may help: https://stackoverflow.com/questions/24097826/read-and-write-a-string-from-text-file – koen Dec 18 '19 at 13:12
  • 1
    Does this answer your question? [Read and write a String from text file](https://stackoverflow.com/questions/24097826/read-and-write-a-string-from-text-file) – Joakim Danielson Dec 18 '19 at 13:15

1 Answers1

0
guard let path = try? FileManager.default.url(
    for: .documentDirectory, 
    in: .userDomainMask, 
    appropriateFor: nil, 
    create: false
).appendingPathComponent("Folder/File.txt") else {
    return 
}

try? "Text".write(to: path, atomically: false, encoding: .utf8)`
Dialogue
  • 311
  • 3
  • 5