D. S. | 1 Apr 2006 21:08
Picon

mp3 streaming using tcpserver + sox

Michael Herger slim at herger.net
> Re: Simple Streaming of MP3 Audio from a Soundcard
> ... http://www.blott-online.com/soundcard.html ...
> Bingo. That helped. Now my winamp is correctly connecting to
> the tcpserver. But there's still no sound. All I get is
> two peaks of noise per second. :-(

Did you ever get sox with tcpserver to work?   I FINALLY got winamp to
accept the stream when I gave it a header it liked.

$ tcpserver -v -H -l 0 -R -D -c 2 YOUR.IP.ADDR.HERE 8080 /bin/sh
/home/Doug/stream/sc9.sh

$ cat sc9.sh
#!/bin/sh
perl /home/Doug/stream/icyhdr.pl 8
sox -t ossdsp /dev/dsp -t mp3 -r 8000 -

$ cat icyhdr.pl
#!/usr/bin/perl
#  from http://search.cpan.org/src/ALLENDAY/MP3-Icecast-0.02/Icecast.pm
my $offset = 0;
my $size= 0;
my $output = '';
my $description = 'unknown';
my $genre= 'unknown genre';
my $path = '';
my $bitrate = $ARGV[0] | 32;
my $mime = 'audio/x-mp3';
my $CRLF = "\015\012";
(Continue reading)

Paul Jarc | 1 Apr 2006 22:02
Picon

Re: Prerelease of SoX 12.18.1

Chris Bagwell <chris <at> cnpbagwell.com> wrote:
> I'd like to release a new version of SoX pretty soon.  So I've packaged 
> up current CVS to help people download it and test it.

src/testall.sh filled up my /tmp.  Could it use $TMPDIR instead?

paul

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
Florian Parnigoni | 7 Apr 2006 15:40

Extra non-audio information

Hello,
I am developing an application that converts different files to a-law files using SoX.
But now I am facing the problem, that the source files may contain some extra non-audio information which results in SoX ignoring the data-bytes length header value and including this non-audio data in the data-portion of the resulting file.
 
For example (Just reading in an a-law file and writing it out unmodified as a-law):
An a-law file with a data-length value of 0x01D407 and some trailing non-audio data will be converted into an a-law file with a data-length of 0x01ECAC containing a noise burst at the end (the remaining 6309 bytes which are the non-audio data)
 
Now I would like to know if there is a way to make sox obey the header information, so only the specified amount of data bytes are converted into the target file and the rest of the data being discarded or again marked as non-audio data?
 
Thanks in advance,
kind regards,
Florian
Chris Bagwell | 7 Apr 2006 17:22

Re: Extra non-audio information

On Fri, Apr 07, 2006 at 03:40:16PM +0200, Florian Parnigoni wrote:
> Now I would like to know if there is a way to make sox obey the header
> information, so only the specified amount of data bytes are converted
> into the target file and the rest of the data being discarded or again
> marked as non-audio data?

What file format are you using?  I'm guessing WAV files because its
pretty popular to have extra data at the end.

Assuming its WAV file, first make sure your running the latest
version of SoX as there was some bugfixes in this area in 12.17.9.

Next, for WAV files SoX does attempt to detect "cooledit" chunks
at the end of the file.  If found then it only reads xxx bytes
as specified by the header.

Probably you have a file that has chunks at the end but not in
standard cooledit format.  It should be pretty simple to add
support for new chunk types and ignore them as needed.

Chris

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
jouzts | 7 Apr 2006 04:12

Combining 2 stereo wavs into quad wav


I am trying to add synthesized surround to a stereo wav file. I have
processed the original stereo channels to create a second stereo wav file
that I want to become the rear channels of a quad wav file. How do you
combine two stereo wavs into a quad wav?

Many thanks,

John
--
View this message in context: http://www.nabble.com/Combining-2-stereo-wavs-into-quad-wav-t1409659.html#a3796563
Sent from the SoX forum at Nabble.com.

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
Chris Bagwell | 8 Apr 2006 19:54

Re: Combining 2 stereo wavs into quad wav

jouzts wrote:
> I am trying to add synthesized surround to a stereo wav file. I have
> processed the original stereo channels to create a second stereo wav file
> that I want to become the rear channels of a quad wav file. How do you
> combine two stereo wavs into a quad wav?
>   

SoX can not currently combine two sound files; only mix them.  It 
wouldn't be to hard to add for those programmers out there.

Chris

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
Florian Parnigoni | 10 Apr 2006 09:04

Re: Extra non-audio information

Hello Chris,
Thanks for your answer. I looked a bit deeper into this and it seems your are correct about the chunk not in
cooledit format.
As I understand from the changelog and the code in wav.c, sox looks for a chunk starting with "LIST" after the
end of the specified wave-data length. 

But the file I have has a the text "bext" on this position, altough it was created by Adobe Audition (which is
the successor of cooledit). As far as I can see, the "bext" marker is part of the "Broadcast Wave
Extension", a standard for extending WAVE files with additional information. 

The Question: Does a patch exist that enables sox to treat the "bext" chunk(s) accordingly, or do you have a
hint for me how to do it myself?

Thanks in advance,
Florian

-----Ursprüngliche Nachricht-----
Von: Chris Bagwell [mailto:chris <at> cnpbagwell.com] 
Gesendet: Freitag, 07. April 2006 17:22
An: Florian Parnigoni
Cc: sox-users <at> lists.sourceforge.net
Betreff: Re: [SoX-users] Extra non-audio information

On Fri, Apr 07, 2006 at 03:40:16PM +0200, Florian Parnigoni wrote:
> Now I would like to know if there is a way to make sox obey the header
> information, so only the specified amount of data bytes are converted
> into the target file and the rest of the data being discarded or again
> marked as non-audio data?

What file format are you using?  I'm guessing WAV files because its
pretty popular to have extra data at the end.

Assuming its WAV file, first make sure your running the latest
version of SoX as there was some bugfixes in this area in 12.17.9.

Next, for WAV files SoX does attempt to detect "cooledit" chunks
at the end of the file.  If found then it only reads xxx bytes
as specified by the header.

Probably you have a file that has chunks at the end but not in
standard cooledit format.  It should be pretty simple to add
support for new chunk types and ignore them as needed.

Chris

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
Chris Bagwell | 10 Apr 2006 15:48

Re: Extra non-audio information

Florian Parnigoni wrote:
> Hello Chris,
> Thanks for your answer. I looked a bit deeper into this and it seems your are correct about the chunk not in
cooledit format.
> As I understand from the changelog and the code in wav.c, sox looks for a chunk starting with "LIST" after
the end of the specified wave-data length. 
>
> But the file I have has a the text "bext" on this position, altough it was created by Adobe Audition (which is
the successor of cooledit). As far as I can see, the "bext" marker is part of the "Broadcast Wave
Extension", a standard for extending WAVE files with additional information. 
>
> The Question: Does a patch exist that enables sox to treat the "bext" chunk(s) accordingly, or do you have a
hint for me how to do it myself?
>   
Its probably pretty simple to ignore the info.  You will need to change 
the wav.c file where it looks for LIST chunk.  It should also support 
detecting bext chunk right there as well.  When its a bext chunk, read 4 
bytes following it using st_readdw().  That value is a length.  Use 
st_seeki() to seek length-4 bytes.

I'm kinda busy on other stuff right now but if you don't get around to 
submitting a patch, I'll add it to my TODO list.

Chris

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
Michael Weiksner | 13 Apr 2006 07:53

A similar MP3 problem as recently posted by zach <zwjunk <at> sb...>

I experience a similar problem with sox where I can certainly read mp3's,
but have some trouble writing mp3's.

Like Zach, I have the following supported formats:

Supported file formats: aiff al au auto avr cdr cvs dat vms gsm hcom la lu
maud mp3 nul prc raw sb sf sl smp sndt sph 8svx sw txw ub ul uw voc vorbis
vox wav wve 

On a variety of files, I can convert from mp3 to ogg.  However, I can't
convert them from ogg back to mp3.  Just like Zach, it starts to run and
never finishes, while creating a file of length zero.  Ctrl-c doesn't work -
I have to press ctrl-z and kill -9 the pid.

As a workaround, I can actually convert these files from ogg back into mp3
using soxwrapper.  (I'm using a Mac OSX)  So it seems that sox *can* work,
but I don't know how soxwrapper does it.

Ultimately,l what I am trying to do is to stretch some audio mp3s to listen
to them faster.  The files are 30-40mgs (about 1hr each).  I can actually do
this on some mp3's, but not on most of them. (e.g., "sox on_interruption.mp3
onx2.mp3 stretch 0.70 40" works but "sox cs547-01.mp3 cs547_01x2.mp3 stretch
0.70 40" does not.)

Anybody have any ideas what might be going on?  Zach and I would greatly
appreciate any insight into what we are doing wrong.

Michael Weiksner

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
Ben Collver | 16 Apr 2006 16:50

synth not doing what i expected

I tried to create a 1 second long A440 sine wave with sox.

sox -t nul /dev/null -r 44100 -c 1 -s -w test1.wav synth 1 sine create 440

Instead I get 10 notes, apparently .05 seconds each.

What am I doing wrong?

Thank you,

Ben

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

Gmane