入室:
For a cs assigment I am using the following code to stream audio. However, now I would like to add the ability to stream files successively, as in a playlist, how can I modify my code to accommodate this? I would like to have a text file of filenames that my script passes through sequentially streaming each. Is this possible? I ve spent a good bit of time googling yet found few relevant links.
Thanks,
CB
#!/usr/bin/perl
use strict;
use CGI::Carp qw/fatalsToBrowser/;
open(OGGFILE, "../HW1/OGG/ACDC.ogg") or die "open error";
my $buffer;
print "Content-type: audio/ogg
";
binmode STDOUT;
while( read(OGGFILE, $buffer, 16384)){
print $buffer;
}
close(OGGFILE);
<>Update:
我在修改了我的法典之后,就建立了一个游戏清单,似乎工作良好。 然而,为了做到这一点,我正在把我的音乐文件存放在我的html夹中,供大家查阅。 是否只是为了防止直接联系和可见度而改变档案许可的问题? 难道我可以修改这一方案,以便把档案从一个文件夹中排出......html之外?
Thanks CB
#!/usr/bin/perl
use strict;
use CGI qw/:standard/;
use CGI::Pretty qw/:standard/;
use CGI::Carp qw/fatalsToBrowser/;
print header(-type=> audio/x-mpegurl ,-expires=> now );
printf "#EXTM3U
";
printf "#EXTINF:-1,Some ACDC song
";
printf "http://www.mywebserver/MP3/ACDC.ogg
";
printf "#EXTINF:-1,Some Pink Floyd Song
";
printf "http://www.mywebserver.com/MP3/PinkFloyd.ogg
";