From b70a7fc963cd58445c55b1d1702e151a39e3fc07 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Thu, 26 Jan 2012 01:43:17 +0100 Subject: mp3dec: resample to target frequency, play: guess mp3 from filename --- rc/bin/play | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'rc') diff --git a/rc/bin/play b/rc/bin/play index 3fd688de8..73fdcf6e5 100755 --- a/rc/bin/play +++ b/rc/bin/play @@ -32,13 +32,16 @@ fn play1 { case *plain* sed 's/ //g' | while(j=`{read}){ echo $"j >[1=2] + t=$typ if(~ $"j http:* https:* HTTP:* HTTPS:*){ - if(~ $#typ 0) typ=mp3 - hget -r 'Icy-MetaData: 0' $j | play1 $typ + if(~ $#t 0) t=mp3 + hget -r 'Icy-MetaData: 0' $j | play1 $t } if not { - if(test -r $"j) - play1 <$"j + if(test -r $"j){ + if(~ $#t 0 && ~ $"j *mp3*) t=mp3 + play1 $t <$"j + } if not { echo $argv0: 'can''t open file:' $"j >[1=2] } -- cgit v1.2.3