OESF Portables Forum
Everything Else => General Support and Discussion => Zaurus General Forums => Archived Forums => Software => Topic started by: daniel3000 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 (http://sourceforge.jp/projects/zaurus-ja/files/?release_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
-
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.
-
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:
$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
-
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.
-
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
-
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?!?
-
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