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
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.