Comment by 🚀 me

Re: "streaming radio on spartan"
In: s/Geminispace

@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 😇

🚀 me

Dec 15 · 2 days ago

22 Later Comments ↓

🐙 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 · Dec 16 at 20:01:

@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 · 22 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 · 22 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 · 20 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 · 19 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] · 7 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] · 5 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 · 5 hours ago:

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

🐙 norayr [OP] · 4 hours 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.

🐙 norayr [OP] · 1 hour ago:
— /u/norayr/image/720.png

and with ogg we also have metadata.

Original Post

🌒 s/Geminispace
— spartan://radio.norayr.am

streaming radio on spartan — 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: [https link] spartan radio player

💬 norayr · 31 comments · 5 likes · Dec 15 · 2 days ago