File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 1- Jukebox
2- =======
1+ #Jukebox
32
43A nodeJS youtube jukebox application. Great for parties and stuff :-)
54
6- Shoutout to ningu in #node.js who helped me with ffmpeg stuff :-)
5+ ##Dependancies
6+ - Avahi (` sudo apt-get install libavahi-compat-libdsnssd-dev ` for debian/ubuntu, windows users go [ here] ( https://developer.apple.com/bonjour/ ) )
7+ - Speaker (` sudo apt-get install libasound2-dev ` for debian/ubuntu, no install required for windows)
8+ - Ffmpeg (` sudo apt-get install ffmpeg ` for debuan/ubuntu, windows users can get it [ here] ( http://ffmpeg.zeranoe.com/builds/ ) )
Original file line number Diff line number Diff line change @@ -45,8 +45,12 @@ function getInfo (video_id, callback){
4545
4646function play ( video_info ) {
4747 console . log ( "Now Playing: " + video_info . title ) ;
48- var proc = new ffmpeg ( { source : request ( video_info . audioURL ) , nolog : true } ) . toFormat ( 'wav' ) . writeToStream ( new speaker ) ;
49-
48+ var stream = request ( video_info . audioURL ) ;
49+ var speaker_instance = new speaker ( ) ;
50+ var proc = new ffmpeg ( { source : stream , nolog : true } ) . toFormat ( 'wav' ) . writeToStream ( speaker_instance ) ;
51+ speaker_instance . on ( 'error' , function ( err ) {
52+ console . error ( "ERROR: " + err ) ;
53+ } ) ;
5054}
5155
5256exports . getInfo = getInfo ;
You can’t perform that action at this time.
0 commit comments