Ionshard / pyxis

A Command Line Player for SIRIUS and XM Sattelite Radio
http://www.ionshard.com/pyxis
GNU General Public License v2.0
19 stars 13 forks source link

Record to file #17

Open crowder opened 14 years ago

crowder commented 14 years ago

It would be nice if Pyxis could record a stream to a file (this is easy with mplayer and I've hacked my local sipie to do this, though I'm only recording the raw stream -- mp3 encoding would be superior), optionally.

It would also be nice if Pyxis could be set to record certain shows/channels at certain times (ie., I might like to record Howard Stern 100 from 3AM-9AM Pacific time, M-F). This is a major wishlist item, of course (maybe should be a separate issue?).

Ionshard commented 14 years ago

I agree. adding a -O option wouldn't be too hard. But I think the time recording is better left up to something else mostly because I don't want to have to worry about running in the background. cron comes to mind. Though for that to work a timed recording would be necessary.

0 3 * * 1-5 pyxis -O date.mp3 -t 3h 'howard stern'

would work great.

crowder commented 14 years ago

Yeah, timed recording is exactly what I meant. This would be outstanding.

crowder commented 14 years ago

Can we add notes to the streamed file based on the notifications we're already collecting? Does mp3 support that? Can we automagically trim commercials? ;)

Ionshard commented 14 years ago

What do you mean by notes in the file? If you mean several files based off the notifications well that was originally off the table since there was a big delay in the notifications, but it might be worth while looking into now that we scrape directly from the source.

crowder commented 14 years ago

Notes -- lyrics tags or something? But yeah, slices of the file made from notifications would be cool (as long as each "episode" is getting its own directory). That would be awesome. And yeah, I got the idea reading your changelog and noticing that you're farming the notifications directly from Sirius' servers.

johnrabotnik commented 14 years ago

I've added some inital support for recording Sirius streams to files here: kasuko/pyxis@fb5a61b8610586eb16f1

By default it saves recordings to ~/pyxis but this and the mplayer recording options can be modified in the pyxisrc config file.

To record a stream to a file add --record to the command line:

pyxis --record --quiet "howard 101"
Recording howard 101. Please use Ctrl+C to stop.

Saves to _~/pyxis/howard101_2010-08-0623-31-23.wav

Ionshard commented 14 years ago

Wow, that's great. The joys of Open Source, I spend a while thinking how to do something and it gets done for me :P

James7Bond007 commented 13 years ago

I believe the recording functionality is currently broken in the latest release. My apologies if this is user error. A big thank you to Kasuko and everyone else working on this fantastic, wonderful project!!!

~$ pyxis --record "howard 100" Traceback (most recent call last): File "/usr/bin/pyxis", line 50, in Interface(opts, station) File "/usr/lib/python2.5/site-packages/pyxis/Interface.py", line 59, in init self.player = Player(opts) File "/usr/lib/python2.5/site-packages/pyxis/Player.py", line 23, in init self.streamHandler = StreamHandler(opts) File "/usr/lib/python2.5/site-packages/pyxis/StreamHandler.py", line 36, in init if not os.path.isdir(config.recordings.directory): AttributeError: 'Config' object has no attribute 'recordings'

Ionshard commented 13 years ago

Ok, it was never added to the Config sanity check. I believe running pyxis --setup again will fix this issue, and I will add it to the sanity check.

James7Bond007 commented 13 years ago

That did it - thank you!