Author Topic: Shoutcast Recorder / Player English Ipk Available  (Read 2551 times)

daniel3000

  • Hero Member
  • *****
  • Posts: 1003
    • View Profile
    • http://
Shoutcast Recorder / Player English Ipk Available
« on: November 15, 2005, 03:50:54 am »
Hello,

here is an IPK (tested on SL-C3000) which contains the English version of Shoutcast Player and another Ruby program "Shoutcast Recorder", which I have deviated form the Player script.
I am not a Ruby expert, so this is more a "dirty hack", but it works nicely here.

The Recorder application works exactly as the Player, even plays simultanously while recording, and creates the file /hdd3/Documents/Music_Files/shoutcast_recorder.mp3
(If the directory does not exist, it must be created first; the path and file name can be adjusted in the shoutcast_recorder.rb script)

It does so by invoking two instances of mplayer, both tuning into the same stream, one playing and the other one recording. Please note that it needs twice the network bandwidth of just one stream.

Suggestions welcome, and if the package is tested and works well, please feel free to include it in your feeds.
I agree that it would be nice if the recorder would add a time stamp to the recorded MP3 file name ;-), but I don't now how to implement that in Ruby.

You need the Ruby and Ruby/QTE IPK packages from
http://sourceforge.jp/projects/zaurus-ja/f...se_id=5690#5690
before you install Shoutcast Player / Recorder.


Edited: Attachment changed to new version. Old attachment contained invalid 0-byte file!

Have fun!

daniel
« Last Edit: November 28, 2005, 07:08:21 am by daniel3000 »
SL-C3200 with weeXpc, based on pdaXrom 1.1.0beta3
HP 200LX with MS-DOS 5.0

tml

  • Full Member
  • ***
  • Posts: 105
    • View Profile
Shoutcast Recorder / Player English Ipk Available
« Reply #1 on: November 15, 2005, 04:29:23 am »
Quote
I agree that it would be nice if the recorder would add a time stamp to the recorded MP3 file name ;-), but I don't now how to implement that in Ruby.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=103725\"][{POST_SNAPBACK}][/a][/div]

Something like Time.now.strftime('%Y%m%d%H%M') would do the job -- if this was the question.
SL-C3100

daniel3000

  • Hero Member
  • *****
  • Posts: 1003
    • View Profile
    • http://
Shoutcast Recorder / Player English Ipk Available
« Reply #2 on: November 20, 2005, 05:53:15 pm »
Quote
Quote
I agree that it would be nice if the recorder would add a time stamp to the recorded MP3 file name ;-), but I don't now how to implement that in Ruby.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=103725\"][{POST_SNAPBACK}][/a][/div]

Something like Time.now.strftime('%Y%m%d%H%M') would do the job -- if this was the question.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=103727\"][{POST_SNAPBACK}][/a][/div]

part of the question ;-)

I don't know anything about Ruby.
The lines is the script which create the file is this:

Code: [Select]
$recordfile = "/hdd3/Documents/Music_Files/shoutcastrecorder.mp3"
...
system("mplayer -quiet -dumpstream -dumpfile #{$recordfile} -cache #{$conf['cache']} -playlist #{$tmpfile3} &")

I was able to create this sophisticated code by interpolating what I read in the other lines of the script. ;-)

Could you please let me know how the code had to look like to create a file

/hdd3/Documents/Music_Files/YYMMDD_HHMMSS_shoutcastrecorder.mp3

To make things simpler I'd sacrifice the file name in the $recordfile variable and make it a "target directory" variable, such as this:

$targetdir = "/hdd3/Documents/Music_Files/"

then let the system(mplayer...) command create a file "#{$targetdir}/YYMMDD_HHMMSS_shoutcastrecorder.mp3".

Thanks for any help!

daniel
SL-C3200 with weeXpc, based on pdaXrom 1.1.0beta3
HP 200LX with MS-DOS 5.0

tml

  • Full Member
  • ***
  • Posts: 105
    • View Profile
Shoutcast Recorder / Player English Ipk Available
« Reply #3 on: November 22, 2005, 12:57:52 pm »
Quote
Could you please let me know how the code had to look like to create a file

/hdd3/Documents/Music_Files/YYMMDD_HHMMSS_shoutcastrecorder.mp3

To make things simpler I'd sacrifice the file name in the $recordfile variable and make it a "target directory" variable, such as this:

$targetdir = "/hdd3/Documents/Music_Files/"

then let the system(mplayer...) command create a file "#{$targetdir}/YYMMDD_HHMMSS_shoutcastrecorder.mp3".
[div align=\"right\"][a href=\"index.php?act=findpost&pid=104358\"][{POST_SNAPBACK}][/a][/div]

What about:

$targetdir  = '/hdd3/Documents/Music_Files'
$targetfile = '%Y%m%d_%H%M%S_shoutcastrecorder.mp3'
$recordfile = File.join($targetdir, Time.now.strftime($targetfile))
system("mplayer -quiet -dumpstream -dumpfile #{$recordfile} -cache #{$conf['cache']} -playlist #{$tmpfile3} &")

BTW the $ denotes a global variable (i.e. a variable you can access from about everywhere). Not having actually looked at the source, I'm not sure if this is intended.
SL-C3100

daniel3000

  • Hero Member
  • *****
  • Posts: 1003
    • View Profile
    • http://
Shoutcast Recorder / Player English Ipk Available
« Reply #4 on: November 22, 2005, 03:20:10 pm »
Quote
What about:

$targetdir  = '/hdd3/Documents/Music_Files'
$targetfile = '%Y%m%d_%H%M%S_shoutcastrecorder.mp3'
$recordfile = File.join($targetdir, Time.now.strftime($targetfile))
system("mplayer -quiet -dumpstream -dumpfile #{$recordfile} -cache #{$conf['cache']} -playlist #{$tmpfile3} &")

BTW the $ denotes a global variable (i.e. a variable you can access from about everywhere). Not having actually looked at the source, I'm not sure if this is intended.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=104556\"][{POST_SNAPBACK}][/a][/div]

Thanks, this works like a charm!
Regarding the $ - I have simply copied the syntax of all the other variables' usage. As long as it works, I am happy ;-)

daniel
SL-C3200 with weeXpc, based on pdaXrom 1.1.0beta3
HP 200LX with MS-DOS 5.0

SNi

  • Full Member
  • ***
  • Posts: 105
    • View Profile
    • http://www.sibelle.info
Shoutcast Recorder / Player English Ipk Available
« Reply #5 on: November 24, 2005, 07:11:56 pm »
Quote
Hello,

here is an IPK (tested on SL-C3000) which contains the English version of Shoutcast Player and another Ruby program "Shoutcast Recorder", which I have deviated form the Player script.
I am not a Ruby expert, so this is more a "dirty hack", but it works nicely here.


[div align=\"right\"][a href=\"index.php?act=findpost&pid=103725\"][{POST_SNAPBACK}][/a][/div]

The shoutcastrecorder.rb in this package is a zero byte file?!?

daniel3000

  • Hero Member
  • *****
  • Posts: 1003
    • View Profile
    • http://
Shoutcast Recorder / Player English Ipk Available
« Reply #6 on: November 28, 2005, 07:05:40 am »
Quote
The shoutcastrecorder.rb in this package is a zero byte file?!?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=104875\"][{POST_SNAPBACK}][/a][/div]

Damn! You are right! I didn't know that the IPK creator script does not follow links. That rb file was a symbolic link to another location.

Attached is the new version (0.4en) which contains a valid file and which implements the time stamp creation for the record file name.

daniel
SL-C3200 with weeXpc, based on pdaXrom 1.1.0beta3
HP 200LX with MS-DOS 5.0