* [LAU] (no subject) @ 2007-07-25 17:02 ` Kevin Cosgrove 2007-07-25 17:31 ` David Graff ` (2 more replies) 0 siblings, 3 replies; 5+ messages in thread From: Kevin Cosgrove @ 2007-07-25 17:02 UTC (permalink / raw) To: linux-audio-user-cunTk1MwBs/CEJeg2xFRV2D2FQJk+8+b, sox-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f Hi, Is there a program which will convert a sound file into a text (.txt) or comma separated value (.csv) file? I'm thinking that would be a good route to go in order to import the data from a sound file into a math manipulation program, e.g. octave, maxima, Matlab, Mathcad, Gnumeric, etc. If not, this would seem to be a good enhancement for SoX, or Audacity, or any sound file editor. Thanks.... -- Kevin ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: (no subject) 2007-07-25 17:02 ` [LAU] (no subject) Kevin Cosgrove @ 2007-07-25 17:31 ` David Graff 2007-07-25 17:34 ` Vijay Gaur 2007-07-25 17:36 ` Rafal Maszkowski 2007-07-25 17:37 ` David Graff 2 siblings, 1 reply; 5+ messages in thread From: David Graff @ 2007-07-25 17:31 UTC (permalink / raw) To: sox-users; +Cc: graff kevinc@doink.com said: > Is there a program which will convert a sound file into a text (.txt) > or comma separated value (.csv) file? I'm thinking that would be a > good route to go in order to import the data from a sound file into a > math manipulation program, e.g. octave, maxima, Matlab, Mathcad, > Gnumeric, etc. Someone else will probably know of existing tools for importing audio sample data into one or another math package, but if I had to convert from binary to ascii numerics, I'd probably use sox to convert the input file to a raw single-channel output of appropriate endian-ness, and run a perl one-liner to reformat the binary numbers into strings; e.g.: sox 1chn_pcm.wav -t raw - | perl -e 'while(read(STDIN,$_,2)==2){printf("%d\n",unpack("v",$_))}' > 1ch_pcm.txt (You probably want to elaborate the perl script to produce a different output format, depending on what your math package wants as input.) Dave Graff ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: (no subject) 2007-07-25 17:31 ` David Graff @ 2007-07-25 17:34 ` Vijay Gaur 0 siblings, 0 replies; 5+ messages in thread From: Vijay Gaur @ 2007-07-25 17:34 UTC (permalink / raw) To: sox-users; +Cc: graff [-- Attachment #1.1: Type: text/plain, Size: 1813 bytes --] Hi, Did anyone used sox to convert mp3 to wav. I would greatly appreciate if someone can post me the instructions. I need to convert mp3 file to wav(16KHz, 16bit, mono). Thanks a bunch in advance. Vijay On 7/25/07, David Graff <graff@ldc.upenn.edu> wrote: > > > kevinc@doink.com said: > > Is there a program which will convert a sound file into a text (.txt) > > or comma separated value (.csv) file? I'm thinking that would be a > > good route to go in order to import the data from a sound file into a > > math manipulation program, e.g. octave, maxima, Matlab, Mathcad, > > Gnumeric, etc. > > Someone else will probably know of existing tools for importing audio > sample data into one or another math package, but if I had to convert > from binary to ascii numerics, I'd probably use sox to convert the > input file to a raw single-channel output of appropriate endian-ness, > and run a perl one-liner to reformat the binary numbers into strings; > e.g.: > > sox 1chn_pcm.wav -t raw - | > perl -e 'while(read(STDIN,$_,2)==2){printf("%d\n",unpack("v",$_))}' > > 1ch_pcm.txt > > > (You probably want to elaborate the perl script to produce a different > output format, depending on what your math package wants as input.) > > Dave Graff > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Sox-users mailing list > Sox-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/sox-users > -- Regards, Vijay Gaur Do you green? www.LimeAll.com [-- Attachment #1.2: Type: text/html, Size: 2609 bytes --] [-- Attachment #2: Type: text/plain, Size: 315 bytes --] ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ [-- Attachment #3: Type: text/plain, Size: 158 bytes --] _______________________________________________ Sox-users mailing list Sox-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sox-users ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: (no subject) 2007-07-25 17:02 ` [LAU] (no subject) Kevin Cosgrove 2007-07-25 17:31 ` David Graff @ 2007-07-25 17:36 ` Rafal Maszkowski 2007-07-25 17:37 ` David Graff 2 siblings, 0 replies; 5+ messages in thread From: Rafal Maszkowski @ 2007-07-25 17:36 UTC (permalink / raw) To: sox-users; +Cc: linux-audio-user On Wed, Jul 25, 2007 at 10:02:21AM -0700, Kevin Cosgrove wrote: > Is there a program which will convert a sound file into a text > (.txt) or comma separated value (.csv) file? I'm thinking that .dat format. R. -- Jeżeli upadnie cywilizacja zachodnia, to będzie szansa na odbudowę cywilizacji chrześcijańskiej. (dr Stanisław Krajski, Radio Maryja, 10 X 2001) ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: (no subject) 2007-07-25 17:02 ` [LAU] (no subject) Kevin Cosgrove 2007-07-25 17:31 ` David Graff 2007-07-25 17:36 ` Rafal Maszkowski @ 2007-07-25 17:37 ` David Graff 2 siblings, 0 replies; 5+ messages in thread From: David Graff @ 2007-07-25 17:37 UTC (permalink / raw) To: sox-users Sorry -- there was a mistake in that perl script -- it should have been: perl -e 'while(read(STDIN,$_,2)==2){printf("%d\n",unpack("s",$_))}' Note the "s" (for signed short int in native byte order), instead "v" (unsigned short int in "VAX" (little-endian) byte order) -- the "s" assumes that you're using a little-endian machine. If you aren't, use the "-x" (xinu) option on sox to invert the byte order of ms-wav pcm files. Dave Graff ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-07-25 17:44 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <kevinc@doink.com> 2007-07-25 17:02 ` [LAU] (no subject) Kevin Cosgrove 2007-07-25 17:31 ` David Graff 2007-07-25 17:34 ` Vijay Gaur 2007-07-25 17:36 ` Rafal Maszkowski 2007-07-25 17:37 ` David Graff
Code repositories for project(s) associated with this public inbox https://80x24.org/mirrors/sox.git This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).