resulting wav converts back to text with wav2cas succesfully
rewrite code for stdin stdout (as below) and also can lose irrelevant header stuff