Show HN: Instantly listen to any URL
per.quest
per.quest
When I put in https://localhost:443, I get audio for the default nginx page, which matches what the internet archive has for that url: https://web.archive.org/web/20210620003533/http://localhost/
But putting http://localhost returns the audio from per.quest's home page.
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
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):On Desktop, one can do text to speech conversion using mozilla TTS:
https://github.com/mozilla/TTS
Or Amazon 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.h...
Full disclaimer: I am the developer of the app and the Android version is brand new (released at 4am this morning).
One minor request: I realize the form page itself is very minimal, but this would be much more usable on a phone if you set the font-size of the input to at least 16px, and a reasonable viewport meta tag eg `<meta name="viewport" content="width=device-width, initial-scale=1">`
Nowadays, <meta name="viewport" content="width=device-width"> works just fine.
But in my opinion I think that you should make the website fully work without the use of client-side JavaScript.
Not that I dislike JavaScript, in fact, I love it. And it's great! But there are several reasons I think that this would make sense doing.
Here is a detailed explanation for "why":
The website already works without the use of client-side JavaScript, only not the index.
If you for example go to: https://per.quest/https://example.com it will work just fine and redirect you to the generated MP3 file.
But if you put https://example.com inside of that input on the website index and have JavaScript disabled it simply won't work. There also is no notice that it does not work without JavaScript enabled.
The solution to this is simple and I think that it would not be hard to change the way you are getting the user given URL from your back-end. What I think would make more sense doing is to just make it work using a URL query parameter.
For example: https://per.quest?url=https://example.com
... which would then allow you to make use of HTML forms, and simply add the "name" attribute to the input with the value set to "url".
So, this would then work in both cases: when the user hit enter and/or pressed a button inside of the form.
Hope that you will agree with me on this!
As far as tts, while the cloud speech is unmatched, it's still proprietary and not free. However there are plenty of really good open source solutions which work extremely well(sample from the one I'm using: https://storage.googleapis.com/adocs_g/example.wav). I use it all the time and in terms of resource usage it's completely unnoticeable. But again, I'm the sole user and on pretty powerful hardware so...
javascript:audio=document.createElement('audio');audio.controls=true;audio.autoplay=true;audio.src='https://per.quest/'+document.location.href;audio.style='position:fixed;right:0;top:0;height:revert;z-index:10000;';document.body.appendChild(audio);javascript:(function(){audio=document.createElement('audio');audio.controls=true;audio.autoplay=true;audio.src='https://per.quest/'+document.location.href;
audio.style='position:fixed;right:0;top:0;height:revert;z-index:10000;';document.body.appendChild(audio);})();
Why is there no donation option for this project?
Why not add a email signup for updates/news?
What are your options for micro monetization?
There must be some type of cost on their end. Heck I’m happy to invest!
Curious if you like it. It (TinyGem) has been a passion project of mine for a while now.
URL used: https://www.bbc.com/news/world-asia-india-43581122
curl -L https://per.quest/$URL | mpv - # or aplay etc. ffplay https://per.quest/$URLApparently it's serving zero-byte mp3s?
I think I'll be using your service from now on! Browser/OS agnostic, no highlighting, and pausing!
Nice to haves: - ability to pick a different voice - playback speed controls - maybe load the original article in an iframe below the player to be able to follow along
javascript:audio=document.createElement('audio');audio.controls=true;audio.autoplay=true;audio.src='https://per.quest/'+document.location.href;audio.style='position:fixed;right:0;top:0;height:revert;z-index:10000;';audio.onmousemove=(e)=>{audio.playbackRate=e.layerX>150?(e.layerX>250?0.55:0.75):(e.layerX<10?1.3:1);};document.body.appendChild(audio);Hopefully some point soon we will have options for more natural speech.
got this error: https://i.imgur.com/bESQdJp.png
[0] https://sambhav.saggis.com/en/blog/hashing-data-with-chess
https://chrome.google.com/webstore/detail/speechify-for-chro...
You can do the same in our iOS App: https://apps.apple.com/us/app/id1535903742
Browse to any page and click on "Listen Now" in the app (including logged in page)
It would be nice if we can choose languages other than English.
edit: tried it out it makes an MP3 file so yeah, one way to do it is with a service like AWS Polly that is not free.
Step 2. Text to Speech (eg. Mozilla DeepVoice)
Both libraries open-source and free.