summaryrefslogtreecommitdiff
path: root/rc/bin
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@rei2.9hal>2012-01-26 01:43:17 +0100
committercinap_lenrek <cinap_lenrek@rei2.9hal>2012-01-26 01:43:17 +0100
commitb70a7fc963cd58445c55b1d1702e151a39e3fc07 (patch)
tree366f47092a174f481ad7311907a03b677b6ae601 /rc/bin
parent173a01ef8b43690f2f3f02d75d03d83436d8022d (diff)
mp3dec: resample to target frequency, play: guess mp3 from filename
Diffstat (limited to 'rc/bin')
-rwxr-xr-xrc/bin/play11
1 files changed, 7 insertions, 4 deletions
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]
}