Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Jan 2010 12:38:19 -0800
From:      Gary Kline <kline@thought.org>
To:        Dan Nelson <dnelson@allantgroup.com>
Cc:        Glen Barber <glen.j.barber@gmail.com>, freebsd-questions@freebsd.org
Subject:   Re: any port use /dev/dsp directly?
Message-ID:  <20100115203819.GB95648@thought.org>
In-Reply-To: <20100115171217.GE5651@dan.emsphone.com>
References:  <20100114012059.GA3921@thought.org> <20100114013746.GB67999@orion.hsd1.pa.comcast.net> <20100114024242.GA9744@thought.org> <20100114165717.GA5651@dan.emsphone.com> <20100114201616.GA73961@thought.org> <20100114211947.GB5651@dan.emsphone.com> <20100114223105.GA84284@thought.org> <20100114230825.GD5651@dan.emsphone.com> <20100115001351.GA27272@thought.org> <20100115171217.GE5651@dan.emsphone.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jan 15, 2010 at 11:12:17AM -0600, Dan Nelson wrote:
> In the last episode (Jan 14), Gary Kline said:
> > On Thu, Jan 14, 2010 at 05:08:25PM -0600, Dan Nelson wrote:

	[[ ... ]]
> > > 
> > >   sox myfile.wav -b 16 -e signed -r 22050 -c 2 myfile.raw
> > > 
> > > will convert the wav file (whatever its format is) to a signed 16-bit
> > > stereo raw file.  For raw files, you can also use special file
> > > extensions that specify the encoding ("myfile.s16" for example, for a
> > > signed 16-bit file).  Adding "-V3" to the beginning of the command will
> > > print the full input and output specs, plus the filter chain required to
> > > do the conversion (if any).  The sox and soxformat manpages are pretty
> > > comprehensive.
> > > 
> > 
> > yes, the man page is thorough, but almost unreadable, at least to me.  i
> > found a tutorial with exaples that should the WAV to RAW conversion.  on
> > my freebsd desktop, sox didn't like it.  it kept echoing the usage.
> 
> That is a bit annoying, yes, but right before the usage test, it should have
> printed an error message saying what it didn't like about your commandline.
>  
> > on my ubuntu system, sox failed completely complaining that that it wasn't
> > set for "auto" .....  [?] I checked again here to see if sox as play would
> > work, and it does.  so at least that much works.
> > 
> > the error output escapes me.  doesn't the ``-r 22050'' specify the
> > sampling rate?
> 
> Yes, but that was during the wav->raw conversion.  The sample rate wasn't
> stored in the raw file, because raw files are just that: raw audio data,
> with no headers indicating sampling rate for encoding format.  For the play
> command to be able to handle a raw file, it needs to be told the rate and
> format when it's run.
>  
> > play FAIL formats: bad input format for file `myfile.raw': sampling rate was not specified
> 


	Hm.  Well, once I'm further along in this stuff I'll ask your help
	again.  I made more changes, happily advancing my project, just before
	I threw in the towel and went to watch the news.  Spiders were gluing me
	to the desk with their webs.  One immediate thought is that the -r
	22050 may have been way too large since the WAV file is 8000Hz and
	mono.  It is small as-is, but it wouldn't hurt to have it shrung by 
	stripping off the header.

	just a thought.


> -- 
> 	Dan Nelson
> 	dnelson@allantgroup.com
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"

-- 
 Gary Kline  kline@thought.org  http://www.thought.org  Public Service Unix
        http://jottings.thought.org   http://transfinite.thought.org
    The 7.79a release of Jottings: http://jottings.thought.org/index.php




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100115203819.GB95648>