Moode Forum

Full Version: Delay Web Radio - Personal Project - Advice/Suggestions Wanted
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey Moode Forum Peeps,

I have a silly little goal I would like to achieve and wondered if anybody here with their experience of computing and audio might have some pointers, tips, advice or even a solution? I am willing to do the work required.

The "Problem":
- I use Moode as an alarm clock everyday but on the weekend the show I want to listen to starts earlier than I want to wake up.
- MyShow starts at time t0; MyAlarm is at time t1 > t0. MyShow ends at t2 >> t1
- As such I would love to achieve the following....

1. At time t0 I connect to the radio stream and buffer/save/store the audio of MyShow somewhere on my network.

2. At time t1 MyAlarm activates and Moode plays the buffered/saved audio from that somewhere.

3. As a super bonus, I can pause the track/steam on Moode and resume it later, for example when I go to the shops and return. 

I have at my disposal some Pis and some minor programming experience.
I can use bash & python, and possibly Java, JS etc if needed.
I have considered Icecast, or mpd output plugins, ffmpeg, etc
I have two moode players, a central pi-based file server which also runs LMS which I often use for multi-room audio via moode.  I also have a spare pi or two.

I am simply not sure what the best way to approach this problem is. I don't know if it is complex or easy, if I am complicating it or not etc etc. I have tried saving the stream to file using ffmpeg (I do this with cronjobs for other shows I want to listen to after they are complete) but moode/mpd fails (perhaps unsurprisingly) to play the incomplete file properly - the playback ends even though there is audio still being added to the file.

I am willing to consider any solution but I wish to avoid any interaction with the system beyond initial setup and setting the moode alarm. 

If anybody has a suggestion of how to achieve this I would love to hear them. Thanks!
An interesting project and requirement.... I don't think I can add much other than possibly investigating arecord . Using another device then piping it to a file  then using  aplay to send it to MoOde with a suitable delay.

I use a headless thinclient running Ubuntu server to record LPs to a Ram-Drive and I can initiate the recording via ssh. I then start another ssh instance and pipe the arecord stream to aplay and send  the audio to my desktop PC for monitoring.
Setting some sort of delay between the two might work. ?


These links may be useful
https://stackoverflow.com/questions/1029...fered-pipe
https://stackoverflow.com/questions/3239...stom-delay
(09-22-2021, 01:31 AM)DRONE7 Wrote: [ -> ]An interesting project and requirement.... I don't think I can add much other than possibly investigating arecord . Using another device then piping it to a file  then using  aplay to send it to MoOde with a suitable delay.

I use a headless thinclient running Ubuntu server to record LPs to a Ram-Drive and I can initiate the recording via ssh. I then start another ssh instance and pipe the arecord stream to aplay and send  the audio to my desktop PC for monitoring.
Setting some sort of delay between the two might work. ?


These links may be useful
https://stackoverflow.com/questions/1029...fered-pipe
https://stackoverflow.com/questions/3239...stom-delay

Thanks Drone!

The research continues.... Smile
Apparently the tvheadend component of Kodi can time shift internet radio stations (cf https://forum.kodi.tv/showthread.php?tid=345155). You might explore their codebase https://github.com/xbmc/xbmc.

Regards,
Kent
Another couple of finds.... a 12 yr old python script....
https://stackoverflow.com/questions/3385...linux-bash

and an android app that has a configurable delay (not sure how long it accepts) that you could then stream to MoOde from your phone ?
https://www-clacsoft-com.translate.goog/...=ajax,elem
https://play-google-com.translate.goog/s...=ajax,elem

and the forums here might be of use ?
https://www.internet-radio.com/community/