streaming radio on spartan

spartan://radio.norayr.am

you can listen to it in lagrange browser.

if you press pause, then resume will resume from the place you pressed pause.

you need to close and reopen the tab to get the stream from the current place.

otherwise you can listen to it via player. i guess via any spartan client that can pipe to a media player.

one such a player is here:

spartan radio player
Posted in: s/Geminispace
🐙 norayr

Dec 15 · 2 days ago · 👍 mozz, Cotteux, roughnecks, me, theo

30 Comments ↓

🚀 argyle · Dec 15 at 16:02:

Cool station. Neat that it works over gemini.

🐙 norayr [OP] · Dec 15 at 16:15:

almost: i decided it doesn't make sense to crypt it, so it uses spartan. and most classic web radios use http, not https, also don't crypt.

🐙 norayr [OP] · Dec 15 at 16:24:

i see mobile lagrange is not able to playback the stream, not sure why.

🐉 theo · Dec 15 at 17:41:

@norayr, same thing. Desktop works great.

🦎 bluesman · Dec 15 at 18:58:

Cool. Works in Alhena. This is the exact thing I was looking for a few weeks back.

🚀 me · Dec 15 at 20:26:

@bluesman here Alhena asks to store a file and then it continuosily starts downloading...

☕️ Homer · Dec 15 at 20:28:

Have you tried if it would work using the opus codec instead of an mpeg?

🦎 bluesman · Dec 15 at 20:48:

@me Assuming you've configured VLC and it's enabled, it sounds like you haven't enabled streaming in the Settings menu.

🚀 me · Dec 15 at 21:07:

@bluesman: streaming is enabled, but no vlc installed. we usually use mpv. btw. would be nice to give a warning when enabling streaming and no player is configured 😇

🐙 norayr [OP] · Dec 15 at 21:21:

@Homer, i already have all my tracks as mp3 and ogg. the same tracks are used for a podcast. mp3's are on http, and ogg's are on gemini.

i don't remember why, ogg worked better with lagrange. when not streaming, but when it is a link to a file.

when streaming, with ogg if you connect in the middle, it doesn't work, but with mp3 it works.

would it work with opus?

☕️ Homer · Dec 15 at 21:37:

I don't know.

But I know that the quality of the opus is higher than that of the mp3. With smaller files in size, better audio quality is achieved.

🦎 bluesman · Dec 15 at 22:42:

@me Yeah, sorry. Without VLC there's no inline audio or video. Basically a no-op. You also don't get audio visualizations. I do plan to disable those menus if VLC isn't activated, FWIW.

🐙 norayr [OP] · Dec 15 at 23:09:

@bluesman, can alhena play with mplayer or mpv?

🦎 bluesman · Dec 16 at 00:01:

@norayr Not at the moment. Alhena uses the vlcj library to offer inline media playback via VLC. I considered an option to open other players but it wouldn't be inline. (I could probably make any player work with Spartan and Gemini as long as it accepted HTTP URLs to localhost).

🐙 norayr [OP] · Dec 16 at 00:09:

@bluesman these are arguments that my player uses to pipe the stream to ffplay, mpv and vlc.

— args in go code
🦎 bluesman · Dec 16 at 01:48:

@norayr That's cool. Just pipe in the stream. I couldn't do that with embedded VLC so I had to take another approach. I'll look at doing this for external playback.

🦂 zzo38 · Dec 16 at 05:31:

What file format is it? The command "astroget 'spartan://radio.norayr.am/radio' | play -" does not work on my computer.

🦎 bluesman · Dec 16 at 06:40:

@norayr I got it working using my existing code for vlcj streaming. I tested "external" vlc, mpv and ffplayer without issues. The hard part will be the UI. Do I assume players will be in the path or does the user specify location? Do I support other players and allow configurable command line options, etc, etc.

There are some hypnotic tunes on your station, BTW.

🐙 norayr [OP] · Dec 16 at 11:00:

@zzo38, it's mp3 stream. because as i understand, if i want to stream ogg, the players can't tune in from the middle of the file, they need header.

🐙 norayr [OP] · Dec 16 at 11:01:

folks i will update the radio today, please forgive me, for a moment i'll restart it.

i have added shuffle and playlist.

🐙 norayr [OP] · Dec 16 at 11:55:

sorry, restarted,. now shuffling the playlist.

🦎 bluesman · 21 hours ago:

@me @norayr If you build from source, you can now try external player support. I tested with ffplay, mpv and vlc on MacOS and vlc and ffplay on Windows. You must enter the player command under "External Player" in the Settings/Media menu and make sure "Inline VLC" is turned off.

Here's the ffplay command for my Mac:

/usr/local/bin/ffplay -loglevel quiet %1

%1 is where the Alhena substitutes the streaming URL when calling the program. There's a neat little visualization in Alhena while media is streaming. At the moment, you can't configure video and audio separately (say, inline video but external audio). I'll add that at some point.

I haven't tested on Linux yet but it should work. There are some players that don't appear to like the simple HTTP stream (wmplayer on Windows and QuickTime on Mac being two examples).

🚀 me · 19 hours ago:

so i just tried on pmos/alpine. added /usr/bin/ffplay and clicked on the link. it then wrote on the buttom left: opening /usr/bin/ffplay but it does play nothing, when i search if any ffplay instance is running, there does not show up any running.

🚀 me · 19 hours ago:

@bluesman: it works, i did not see that it had to end with %1 (mobile screen size )

@norayr can youbtry on maemo leste :)

THANK YOU for the fast fix

just stopping is not possible, but does not matter, closing and reoping alhena or killing from terminal.

🦂 zzo38 · 17 hours ago:

I changed "play -" to "ffplay -f mp3 -", and it works now. (It displays an error message that the header is missing, but it works anyways, despite that.)

🦎 bluesman · 16 hours ago:

@me If you click the link to the audio stream a second time, it closes the player. If there is no link (say you opened the stream from a bookmark), closing the parent window or tab closes the player. In that situation, I just create a new tab and then close the tab that opened the player.

🐙 norayr [OP] · 3 hours ago:

tip from zilog on sdf chat:

just listen like this:

echo 'radio.norayr.am /radio 0' |nc norayr.am 300 |sox -tmp3 - -d
🐙 norayr [OP] · 2 hours ago:

ok i fixed it.

now we stream only ogg. and i generate ogg headers and mobile players like lagrange mobile should play it.

🦎 bluesman · 1 hour ago:

Works great. How about opus? (Just kidding). Was the ogg switch just for less bandwidth?

🐙 norayr [OP] · 1 hour ago:

i just already have oggs for all my sets.

btw if anyone knows how to make android/ios to not cut the stream when the screen goes blank, share tips.

in sailfish i found an option in Settings -> Display -> do not blank when charging.