4 ms·
Not sure about OP but I just implemented this in my Hacker News android client (thanks for the idea OP). This is how I implemented it. I had already achieved a
by busymom0 5y ago
Not sure about OP but I just implemented this in my Hacker News android client (thanks for the idea OP).
This is how I implemented it. I had already achieved article to "reader mode" extraction by heavily customizing the Kotlin port of Mozilla‘s Readability:
https://github.com/dankito/Readability4J https://github.com/dankito/Readability4J
From the extracted "reader mode" text, I had to do further extraction to get rid of things like image captions, author names, article publish timestamps etc. Also links had to be removed to not let the TTS engine speaking out links.
Then I pass the text via Android's TextToSpeech library and it works very well:
fun trySpeaking(str:String){
fun speak(){
tts?.speak(str, TextToSpeech.QUEUE_FLUSH, null, null)
}
tts?.also {
it.stop()
speak()
} ?: run {
tts = TextToSpeech(appContext) { status ->
println("Speak: $status")
if (status == TextToSpeech.SUCCESS) {
speak()
}
}.apply {
language = Locale.US
}
}
}
If someone wants to do a tl;dr on the article text, they could pass it through SMMRY api (which the Reddit's TL;DR bot uses):
https://smmry.com https://smmry.com
On Desktop, one can do text to speech conversion using mozilla TTS:
https://github.com/mozilla/TTS https://github.com/mozilla/TTS
Or Amazon Polly:
https://aws.amazon.com/polly/ https://aws.amazon.com/polly/
For anyone wanting to give it a try, this "article to audio" will be available in tomorrow's update in my app. The reader mode is already available:
https://play.google.com/store/apps/details?id=com.pranapps.hack https://play.google.com/store/apps/details?id=com.pranapps.h...
Full disclaimer: I am the developer of the app and the Android version is brand new (released at 4am this morning).
- neolog 5y agoI really want one of these that can follow RSS/Atom feeds.
- busymom0 5y agoCan you explain a bit more on your requirement? I could build something like that if I understand a bit more details.
- neolog 5y agoIt would be like a cross between RSS reader and podcast app. So I can listen to my favorite blogs instead of reading them. And the list would update from the RSS feed. It would probably require some text cleaning like [1] and a good text-to-speech API. [1] https://newspaper.readthedocs.io/en/latest/ https://newspaper.readthedocs.io/en/latest/
- busymom0 5y agoThanks. I will dig further and see what I can build.
- ari__ 5y agoInoreader may provide what you're looking for!
- hopesthoughts 5y agoWell just download NVDA, and run it through you're RSS reader. It will read RSS feeds for you. I don't think that's what you're getting at, but it will do that, just as it does other things.