Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Record to file #17

Open
crowder opened this issue Jul 29, 2010 · 10 comments
Open

Record to file #17

crowder opened this issue Jul 29, 2010 · 10 comments

Comments

@crowder
Copy link
Contributor

crowder commented Jul 29, 2010

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
Copy link
Owner

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
Copy link
Contributor Author

crowder commented Jul 29, 2010

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

@crowder
Copy link
Contributor Author

crowder commented Jul 29, 2010

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
Copy link
Owner

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
Copy link
Contributor Author

crowder commented Jul 29, 2010

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
Copy link
Collaborator

I've added some inital support for recording Sirius streams to files here: 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-06_23-31-23.wav

@Ionshard
Copy link
Owner

Ionshard commented Aug 9, 2010

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
Copy link

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
Copy link
Owner

Ionshard commented Feb 9, 2011

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
Copy link

That did it - thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants