- or download this
my $buf;
while ( read(STDIN, $buf, 128) ) {
print SOCKET, $buf;
}
- or download this
# open up our pipe and turn off the default buffering
open AUDIO_OUT, "|/usr/bin/aplay -f S32_BE -r22050 -c2 --buffer-time=5
+00000 -" or die "aplay pipe broken\n";
...
while ( defined( $stream = <CLIENT> ) ) {
print AUDIO_OUT $stream;
}