Is it possible to make “HTML to speech” same like “Text to speech”?

后端 未结 4 818
余生分开走
余生分开走 2021-02-12 14:13

I have one weird requirement that in my existing app I have Text2Speech and for that, I have used AVSpeechSynthesizer to speech text, but now my client

4条回答
  •  孤城傲影
    2021-02-12 14:55

    One way or another it will always be parsing HTML to something else if you don't want to read files. If the client want direct HTML2Speech solution you can provide a method that takes html file as an argument and read it. What's happening with this file under the hood should not bother client that much as long as it's clean and not causing problems.

    What happen when client will ask for Markdown2Speech or XML2Speech. For what i see in your desciption is better to have it for now in one framework with two public methods Text2Speech and HTML2Speech that will take as argument link to file or NSString.

    So as @rickster suggest it can be NSAttributedString or NSString. There is a lot of parsers out there, Or if you want own solution you can remove everything what's inside < and > and change encoding.

提交回复
热议问题