Spiel1 wrote: 
> 
> Sorry for the longwinded explanation - I thought this was something that
> others were possibly already doing, and that I was just overlooking
> something. I used to have LMS on a Win-2012 server, but it fried a few
> months ago along with my squeezebox player, and that's when took the
> dive into linux and pCP. So far, that has been working out great,
> although the learning curve was a bit steep in the beginning. At any
> rate, thanks for your help - I will live without being able to
> record/stream at the same time, but by the same token, it would make my
> life easier if I could, so any suggestions would be appreciated.
> 
> Thanks,
> Spiel1

OK.  I understand a bit better.

I hope I can explain a basic solution in as simple terms as possible. 

The command that takes input and copy to LMS streams are defined in the
wavinput custom-convert.conf file (shown below).   I think you'd be
better off saving in FLAC format rather than WAV - there is no loss in
data just less space. 

The rule "wavin flc * *" is for playing the input as flac stream -
"arecord" takes audio from input and puts it on stdout.  A second
command "flac" takes the stdout from "arecord" as uses it as its input
from stdin and output compressed. 


Code:
--------------------
    
  #
  # wavin 
  #
  wavin pcm * * 
        # R
        [arecord] -d0 -c2 -f S16_LE -r 44100 -traw -D $FILE$ 
  wavin mp3 * *
        # RB:{BITRATE=-B %B}
        [arecord] -d0 -c2 -f S16_LE -r 44100 -twav -D $FILE$ | [lame] --silent 
-q $QUALITY$ -v $BITRATE$ - -
  wavin flc * * 
        # R
        [arecord] -d0 -c2 -f S16_LE -r 44100 -twav -D $FILE$ | [flac] -cs 
--totally-silent --compression-level-0 -
  
  
  
--------------------


There is a linux command called "tee" - which is a tee junction  - it
passes  stdin to stdout but also makes a copy to a file.

I suggest change the "wavin flac" line in the custom-convert.file to the
following - the change is in red and it means each time WaveInput is
run, output is copied to the file /tmp/wavinputrecord.flc (example name
and directory) and old copy is overwritten.  I haven't tested it but I
have used tee in the past - so there maybe typos in the suggestion.  
I'd wait a few secs afyer end of input to allow seconds of silence to be
recorded and when playing is stopped end of input is captured in the
file.

Code:
--------------------
    
        [arecord] -d0 -c2 -f S16_LE -r 44100 -twav -D $FILE$ | [flac] -cs 
--totally-silent --compression-level-0 - | tee /tmp/wavinputrecord.flc 
  
--------------------


There is an issue about WAV & Flac file header that should be mentioned.
The header is at the start of the file.  The header usually has the
length of the file (i.e. frame count).  As the header is written before
the rest of the file - the header does not contain the length of the
file.  This can result in the file being rejected by some players.  So
player either has to be told ignore length in header or the file header
has to be corrected.  The choice depends on your end use but if you take
the flac file and process it - the header will probably be sorted out as
well.

Changes to custom-convert.conf files only take effect after LMS restart.


------------------------------------------------------------------------
bpa's Profile: http://forums.slimdevices.com/member.php?userid=1806
View this thread: http://forums.slimdevices.com/showthread.php?t=49584

_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to