View previous topic :: View next topic |
Author |
Message |
nzmark n00b
Joined: 13 Jun 2005 Posts: 28
|
Posted: Mon Jun 27, 2005 8:33 am Post subject: wma streaming? |
|
|
is possibly wma streaming under linux like liveice's mp3/ogg streaming? |
|
Back to top |
|
|
dhalsiim Guru
Joined: 29 Jan 2003 Posts: 486
|
Posted: Mon Jun 27, 2005 1:50 pm Post subject: |
|
|
Totem is able to stream wma/wmv's if you use GTK/Gnome. Perhaps a similar player is available in KDE if that's your choice of Desktop environment. |
|
Back to top |
|
|
nzmark n00b
Joined: 13 Jun 2005 Posts: 28
|
Posted: Tue Jun 28, 2005 7:07 am Post subject: |
|
|
dhalsiim wrote: | Totem is able to stream wma/wmv's if you use GTK/Gnome. Perhaps a similar player is available in KDE if that's your choice of Desktop environment. |
dont want to play wma, i would like create and broadcast wma, like liveice + icecast mp3 broadcasting
radio --->soundcard--->xy program---(wma)-->internet
radio---->sound card---> liveice +icecast ---(mp3)----> internet |
|
Back to top |
|
|
dhalsiim Guru
Joined: 29 Jan 2003 Posts: 486
|
Posted: Tue Jun 28, 2005 10:40 am Post subject: |
|
|
I'm sorry I misunderstood 'streaming' for 'listening to it over the internet'. I am of no help here.. perhaps someone else will be able to. |
|
Back to top |
|
|
tuxmagi n00b
Joined: 22 Oct 2004 Posts: 68 Location: Providence, RI
|
Posted: Tue Jun 28, 2005 4:08 pm Post subject: Do it yourself |
|
|
I'm not sure if there is a set program to stream wma's, however it seems that all you need is Perl and a client capable of playing WMAs and opening URLs. Here is a Perl script that I've been using for a while to stream files of any type (mpg, mp3, avi, ...):
Code: |
#!/usr/bin/perl -w
use strict;
use IO::Socket;
#get the port from an argument or default to 8000
my $port = $ARGV[0] || 8000;
#ignore children to prevent zombies
$SIG{CHLD} = 'IGNORE';
#pop open a socket
my $listen_socket = IO::Socket::INET->new(LocalPort => $port,
Listen => 10,
Proto => 'tcp',
Reuse => 1);
#make sure the port was bound successfully
die "Can't bind the listening port: $@" unless $listen_socket;
#notify the user about the server being ready
warn "Server ready. Waiting for connections... \n";
#wait for connections
while (my $connection = $listen_socket->accept){
my $child;
#fork or die!
die "Can't fork: $!" unless defined ($child = fork());
if ($child == 0){
#this is our child!
$listen_socket->close;
#check the clients first message
play_random($connection);
#if the child dies, just leave it be
exit 0;
}else{
#I'm a daddy!
#what's the child's name (IP)
warn "Connection recieved... ",$connection->peerhost,"\n";
#close the connection, we don't need to connect with our children
$connection->close();
}
#go back and make more children!
}
#here's where we do stuff
sub play_random {
my $socket = $_[0];
#check for an IP specific playlist
open PLAYLIST, "playlist.m3u" or die;
my @songs = <PLAYLIST>;
close PLAYLIST;
chomp @songs;
#seed the random number machine thingy
srand(time / $$);
#loop over and over till the client dies
while() {
#send some headers and such
print $socket "HTTP/1.0 200 OK\n";
print $socket "Content-Type: audio/x-mp3stream\n";
print $socket "x-audiocast-name: Fawesome!\n\n";
#grab a random song
my $song = $songs[rand @songs];
#check what song we be playing
warn("Playing song: $song\n");
#open the song or skip it
open(SONG, $song) || next;
#silly windoze...
#binmode(SONG);
my $read_status = 1;
my $print_status = 1;
my $chunk;
#This loop prints the song to the socket uber fast like
while($read_status && $print_status){
$read_status = read(SONG, $chunk, 1024);
if (defined $chunk && defined $read_status){
$print_status = print $socket $chunk;
}
#eat the chunk
undef $chunk;
}
close(SONG);
unless(defined $print_status){
$socket->close();
exit(0);
}
}
}
|
Just put the filenames of the WMAs you want to stream in a a file named "playlist.m3u" (one filename per line) and then place the playlist.m3u file in the same directory as the perl script and execute the script. Then open open up your favorite WMA playable client and open the location "http://localhost:8000". |
|
Back to top |
|
|
nzmark n00b
Joined: 13 Jun 2005 Posts: 28
|
Posted: Fri Jul 15, 2005 12:59 pm Post subject: Re: Do it yourself |
|
|
tuxmagi wrote: | I'm not sure if there is a set program to stream wma's, however it seems that all you need is Perl and a client capable of playing WMAs and opening URLs. Here is a Perl script that I've been using for a while to stream files of any type (mpg, mp3, avi, ...):
Just put the filenames of the WMAs you want to stream in a a file named "playlist.m3u" (one filename per line) and then place the playlist.m3u file in the same directory as the perl script and execute the script. Then open open up your favorite WMA playable client and open the location "http://localhost:8000". |
i would like wma from soundcard (on the fly) and live broadcast. not from hdd files. |
|
Back to top |
|
|
Sashman n00b
Joined: 06 Apr 2004 Posts: 66
|
Posted: Tue Aug 09, 2005 1:13 pm Post subject: |
|
|
I'm not a professional here but you would need a wma encoder and I doubt that there is somethink like that available for linux. |
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
Posted: Tue Aug 09, 2005 2:37 pm Post subject: |
|
|
Also, there may be some legal issues in case you are concerned about things like that. I do not know the licensing details, but the picture is following: You can encode WMA free of charge as long as the encoder runs on a MS OS. You cannot legally decode WMA without paying a royalty fee to MS (i believe it's $1.50). |
|
Back to top |
|
|
sylware Apprentice
Joined: 16 Oct 2004 Posts: 159 Location: European Union (Paris / France)
|
Posted: Tue Aug 09, 2005 11:05 pm Post subject: Why wma? |
|
|
Why do you want to stream with wma??? stream using ogg-vorbis, subscribe to the xiph online radio directory, and you are ready. ogg-vorbis shields you against patent loaded codecs, understand you don't have to pay anything and you are using and promoting a FREE as in FREEDOM codec! |
|
Back to top |
|
|
Gentree Watchman
Joined: 01 Jul 2003 Posts: 5350 Location: France, Old Europe
|
Posted: Thu Sep 22, 2005 6:57 am Post subject: |
|
|
wma must DIE!
Dont use it. _________________ Linux, because I'd rather own a free OS than steal one that's not worth paying for.
Gentoo because I'm a masochist
AthlonXP-M on A7N8X. Portage ~x86 |
|
Back to top |
|
|
|