Jan Stary | 3 Jun 19:58 2011
Picon

coreaudio warnings

I am trying again with 14.3.2 on MacOSX 10.5.8

There is a port of 14.3.2 (via http://www.macports.org/),
but it has ffmpeg as a dependency, which pulls a lot of
unnecessary stuff into my system. So I am compiling
from source.

SoX compiles OK, but there are warnings with respect to
the CoreAudio interface (that's the macos audio subsystem):

coreaudio.c: In function 'RecIOProc':
coreaudio.c:78: warning: unused variable 'i'
coreaudio.c: In function 'setup':
coreaudio.c:153: warning: comparison between signed and unsigned
coreaudio.c:156: warning: passing argument 3 of 'AudioDeviceGetProperty' with different width due to prototype
coreaudio.c:144: warning: unused variable 'device_count'
coreaudio.c:184: warning: passing argument 3 of 'AudioDeviceGetProperty' with different width due to prototype
coreaudio.c:258: warning: passing argument 4 of 'AudioDeviceSetProperty' with different width due to prototype
coreaudio.c:278: warning: 'AudioDeviceAddIOProc' is deprecated (declared at /System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardware.h:2067)
coreaudio.c:280: warning: 'AudioDeviceAddIOProc' is deprecated (declared at /System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardware.h:2067)
coreaudio.c: In function 'stopread':
coreaudio.c:326: warning: 'AudioDeviceRemoveIOProc' is deprecated (declared at /System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardware.h:2081)
coreaudio.c: In function 'write_samples':
coreaudio.c:358: warning: negative integer implicitly converted to unsigned type
coreaudio.c:376: warning: assignment from incompatible pointer type
coreaudio.c: In function 'stopwrite':
coreaudio.c:407: warning: 'AudioDeviceRemoveIOProc' is deprecated (declared at /System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardware.h:2081)

SoX records fine:

(Continue reading)

Антон Иванов | 4 Jun 13:18 2011
Picon

Decoding Buffer

Decode the audio in buffer, so:
out = sox_open_memstream_write (& buffer, & buffer_size, & in-> signal, NULL, "sox", NULL);
while (number_read = sox_read (in, samples, MAX_SAMPLES)) {
sox_write (out, samples, number_read);
}
Accordingly, the buffer is written the entire file. Can I make so that at each iteration in the buffer was just a new part of the audio? I understand - just to clear buffer each time, but how?
------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 
_______________________________________________
Sox-users mailing list
Sox-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users
Антон Иванов | 4 Jun 19:22 2011
Picon

Re: Decoding Buffer

Solved the problem.

2011/6/4 Антон Иванов <wkyborgw <at> gmail.com>
Decode the audio in buffer, so:
out = sox_open_memstream_write (& buffer, & buffer_size, & in-> signal, NULL, "sox", NULL);
while (number_read = sox_read (in, samples, MAX_SAMPLES)) {
sox_write (out, samples, number_read);
}
Accordingly, the buffer is written the entire file. Can I make so that at each iteration in the buffer was just a new part of the audio? I understand - just to clear buffer each time, but how?

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 
_______________________________________________
Sox-users mailing list
Sox-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users
Антон Иванов | 4 Jun 20:29 2011
Picon

Effects and example5


Hello. wrote a program based on example5 getting buffer. Now the question is: how such a program to use the effects? If you can - with sample code?

p.s. try this:
out = sox_open_memstream_write (& buffer, & buffer_size, & in-> signal, NULL, "sox", NULL);

chain = sox_create_effects_chain (& in-> encoding, & out-> encoding);

/ * The first effect in the effect chain must be something that can source
* Samples; in this case, we use the built-in handler that inputs
* Data from an audio file * /
e = sox_create_effect (sox_find_effect ("input"));
sox_effect_options (e, a, args);
/ * This becomes the first `effect 'in the chain * /
sox_add_effect (chain, e, & in-> signal, & in-> signal);

e = sox_create_effect (sox_find_effect ("speed"));
sox_effect_options (e, 2, args);
/ * This becomes the first `effect 'in the chain * /
sox_add_effect (chain, e, & in-> signal, & in-> signal);

e = sox_create_effect (sox_find_effect ("output"));
sox_effect_options (e, a, args);
sox_add_effect (chain, e, & in-> signal, & in-> signal);
/ * Flow samples through the effects processing chain until EOF is reached * /
sox_flow_effects (chain, NULL, NULL);

No result. After this line:
sox_flow_effects (chain, NULL, NULL);
does nothing, ie no decoding going on.
------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 
_______________________________________________
Sox-users mailing list
Sox-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users
Антон Иванов | 6 Jun 10:01 2011
Picon

Re: Effects and example5


So what? Who knows the answer? Please!
2011/6/4 Антон Иванов <wkyborgw <at> gmail.com>

Hello. wrote a program based on example5 getting buffer. Now the question is: how such a program to use the effects? If you can - with sample code?

p.s. try this:
out = sox_open_memstream_write (& buffer, & buffer_size, & in-> signal, NULL, "sox", NULL);

chain = sox_create_effects_chain (& in-> encoding, & out-> encoding);

/ * The first effect in the effect chain must be something that can source
* Samples; in this case, we use the built-in handler that inputs
* Data from an audio file * /
e = sox_create_effect (sox_find_effect ("input"));
sox_effect_options (e, a, args);
/ * This becomes the first `effect 'in the chain * /
sox_add_effect (chain, e, & in-> signal, & in-> signal);

e = sox_create_effect (sox_find_effect ("speed"));
sox_effect_options (e, 2, args);
/ * This becomes the first `effect 'in the chain * /
sox_add_effect (chain, e, & in-> signal, & in-> signal);

e = sox_create_effect (sox_find_effect ("output"));
sox_effect_options (e, a, args);
sox_add_effect (chain, e, & in-> signal, & in-> signal);
/ * Flow samples through the effects processing chain until EOF is reached * /
sox_flow_effects (chain, NULL, NULL);

No result. After this line:
sox_flow_effects (chain, NULL, NULL);
does nothing, ie no decoding going on.

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 
_______________________________________________
Sox-users mailing list
Sox-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users
Chip | 7 Jun 09:24 2011

Transcode from AAC to MP3 (or vice versa)

Hi

I would like to use SoX on an Icecast streaming server - I have been
advised that the application might help. I have a user that would like
to send us a 64kbps AAC stream and have us transcode that to 64kbps
MP3 and 32kbps AAC - is it possible to do this with SoX?

If it is easier, we would be happy to go with another permutation such as:

User sends us 64kbps MP3 and we convert that server-side to 64kbps AAC
and 32kbps ACC.

How would I make a start with this method?

We have a server running Fedora and I have installed SoX and SoX-devel
using yum - but I understand that the default installation package
does not have MP3 support and I will probably have to re-compile the
package myself to include MP3 capability.

Any pointers would be much appreciated and thanks in advance.

Best regards

Chip

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
Антон Иванов | 7 Jun 12:53 2011
Picon

Receiving Buffer parts

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Sox-users mailing list
Sox-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users
Jan Stary | 7 Jun 14:42 2011
Picon

Re: Transcode from AAC to MP3 (or vice versa)

On Jun 07 08:24:37, Chip wrote:
> Hi
> 
> I would like to use SoX on an Icecast streaming server - I have been
> advised that the application might help. I have a user that would like
> to send us a 64kbps AAC stream and have us transcode that to 64kbps
> MP3 and 32kbps AAC - is it possible to do this with SoX?

No; SoX has no native handler for AAC files,
not even when compiled --with-ffmpeg:

$ sox in.wav in.acc    
sox FAIL formats: no handler for file extension `acc'

Trying to use ffmpeg to wrap the AAC data in a MP4 container
segfaults on my installation:

$ sox in.wav in.mp4    
[mp4  <at>  0x83cd5080]Codec for stream 0 does not use global headers but
container format requires global headers
Segmentation fault (core dumped) 

$ soxi in.mp4
[mov,mp4,m4a,3gp,3g2,mj2  <at>  0x85f21080]moov atom not found
soxi FAIL ffmpeg: ffmpeg cannot open file for reading: in.mp4 (code -1)
soxi FAIL formats: can't open input file `in.mp4': 

This is 14.3.2 on OpenBSD; I don't think other versions
would work better in this regard.

> If it is easier, we would be happy to go with another permutation such as:
> User sends us 64kbps MP3 and we convert that server-side to 64kbps AAC
> and 32kbps ACC.

If the user can send both AAC and MP3,
why do you need to convert in the first place?

> How would I make a start with this method?
> 
> We have a server running Fedora and I have installed SoX and SoX-devel
> using yum - but I understand that the default installation package
> does not have MP3 support and I will probably have to re-compile the
> package myself to include MP3 capability.
> 
> Any pointers would be much appreciated and thanks in advance.

http://sourceforge.net/projects/faac/ does RAW/WAV <-> AAC.
So in concert with SoX or lame, you can do RAW/WAV <-> MP3 <-> AAC

Be aware that recoding between lossy compression formats
degrades the audio quality.

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
Jan Stary | 7 Jun 15:01 2011
Picon

Re: Transcode from AAC to MP3 (or vice versa)

On Jun 07 14:42:07, Jan Stary wrote:
> On Jun 07 08:24:37, Chip wrote:
> > Hi
> > 
> > I would like to use SoX on an Icecast streaming server - I have been
> > advised that the application might help. I have a user that would like
> > to send us a 64kbps AAC stream and have us transcode that to 64kbps
> > MP3 and 32kbps AAC - is it possible to do this with SoX?
> 
> No; SoX has no native handler for AAC files,
> not even when compiled --with-ffmpeg:
> 
> $ sox in.wav in.acc    
> sox FAIL formats: no handler for file extension `acc'
> 
> Trying to use ffmpeg to wrap the AAC data in a MP4 container
> segfaults on my installation:
> 
> $ sox in.wav in.mp4    
> [mp4  <at>  0x83cd5080]Codec for stream 0 does not use global headers but
> container format requires global headers
> Segmentation fault (core dumped) 

It's probably the inned ffmpeg that's segfaulting, not SoX itself.
I generally compile --without--ffmpeg.

> $ soxi in.mp4
> [mov,mp4,m4a,3gp,3g2,mj2  <at>  0x85f21080]moov atom not found
> soxi FAIL ffmpeg: ffmpeg cannot open file for reading: in.mp4 (code -1)
> soxi FAIL formats: can't open input file `in.mp4': 
> 
> This is 14.3.2 on OpenBSD; I don't think other versions
> would work better in this regard.
> 
> > If it is easier, we would be happy to go with another permutation such as:
> > User sends us 64kbps MP3 and we convert that server-side to 64kbps AAC
> > and 32kbps ACC.
> 
> If the user can send both AAC and MP3,
> why do you need to convert in the first place?
> 
> > How would I make a start with this method?
> > 
> > We have a server running Fedora and I have installed SoX and SoX-devel
> > using yum - but I understand that the default installation package
> > does not have MP3 support and I will probably have to re-compile the
> > package myself to include MP3 capability.
> > 
> > Any pointers would be much appreciated and thanks in advance.
> 
> http://sourceforge.net/projects/faac/ does RAW/WAV <-> AAC.
> So in concert with SoX or lame, you can do RAW/WAV <-> MP3 <-> AAC

I mean MP3 <-> RAW/WAV <-> AAC of course.

> Be aware that recoding between lossy compression formats
> degrades the audio quality.

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
Chip | 7 Jun 15:57 2011

Re: Transcode from AAC to MP3 (or vice versa)

Hi Jan

Many thanks.

Please see below.

> On Jun 07 08:24:37, Chip wrote:
>> Hi
>>
>> I would like to use SoX on an Icecast streaming server - I have been
>> advised that the application might help. I have a user that would like
>> to send us a 64kbps AAC stream and have us transcode that to 64kbps
>> MP3 and 32kbps AAC - is it possible to do this with SoX?
>
> No; SoX has no native handler for AAC files,
> not even when compiled --with-ffmpeg:
>
> $ sox in.wav in.acc
> sox FAIL formats: no handler for file extension `acc'
>
> Trying to use ffmpeg to wrap the AAC data in a MP4 container
> segfaults on my installation:
>
> $ sox in.wav in.mp4
> [mp4  <at>  0x83cd5080]Codec for stream 0 does not use global headers but
> container format requires global headers
> Segmentation fault (core dumped)
>
> $ soxi in.mp4
> [mov,mp4,m4a,3gp,3g2,mj2  <at>  0x85f21080]moov atom not found
> soxi FAIL ffmpeg: ffmpeg cannot open file for reading: in.mp4 (code -1)
> soxi FAIL formats: can't open input file `in.mp4':
>
> This is 14.3.2 on OpenBSD; I don't think other versions
> would work better in this regard.
>
>> If it is easier, we would be happy to go with another permutation such as:
>> User sends us 64kbps MP3 and we convert that server-side to 64kbps AAC
>> and 32kbps ACC.
>
> If the user can send both AAC and MP3,
> why do you need to convert in the first place?

I think the user want to conserve their upstream bandwidth i.e. they
only send us 64kbps as MP3 or AAC and server-side we push it out as
64kbps MP3, 64kbps AAC and 32kbps AAC (equals 160kbps approximately).

Many thanks again and best regards

Chip

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev

Gmane