From owner-freebsd-questions@FreeBSD.ORG Fri Jan 15 17:12:21 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 188AC106566C for ; Fri, 15 Jan 2010 17:12:21 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from email1.allantgroup.com (email1.emsphone.com [199.67.51.115]) by mx1.freebsd.org (Postfix) with ESMTP id CA9648FC0A for ; Fri, 15 Jan 2010 17:12:20 +0000 (UTC) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by email1.allantgroup.com (8.14.0/8.14.0) with ESMTP id o0FHCJkM010181 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 15 Jan 2010 11:12:19 -0600 (CST) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (smmsp@localhost [127.0.0.1]) by dan.emsphone.com (8.14.4/8.14.3) with ESMTP id o0FHCJrc084230 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 15 Jan 2010 11:12:19 -0600 (CST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.14.4/8.14.3/Submit) id o0FHCHZ2084227; Fri, 15 Jan 2010 11:12:18 -0600 (CST) (envelope-from dan) Date: Fri, 15 Jan 2010 11:12:17 -0600 From: Dan Nelson To: Gary Kline Message-ID: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100115001351.GA27272@thought.org> X-OS: FreeBSD 7.2-STABLE User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: clamav-milter 0.95.3 at email1.allantgroup.com X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2 (email1.allantgroup.com [199.67.51.78]); Fri, 15 Jan 2010 11:12:19 -0600 (CST) X-Scanned-By: MIMEDefang 2.45 Cc: Glen Barber , freebsd-questions@freebsd.org Subject: Re: any port use /dev/dsp directly? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 17:12:21 -0000 In the last episode (Jan 14), Gary Kline said: > On Thu, Jan 14, 2010 at 05:08:25PM -0600, Dan Nelson wrote: > > In the last episode (Jan 14), Gary Kline said: > > > On Thu, Jan 14, 2010 at 03:19:47PM -0600, Dan Nelson wrote: > > > > The sox port comes with its own "play" command that can parse many > > > > containers and encodings, including wav files. > > > > > > I did see that. I'm wondering of theses is some sox translation that > > > would do say > > > > > > %sox -w WAV -r [rawoutfile] > > > > Certainly; file conversion is one of the basic purposes of sox. > > Something like: > > > > 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 -- Dan Nelson dnelson@allantgroup.com