libsox audio chain help

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

libsox audio chain help

Benjamin-63
Hi all,

I am new to libsox and this mailing list, but I am impressed by the quality
of sox's effects.

I read the documentation and the sox.h file, but I don't know right now
where to start.

What I have to do is to use sox's effects (mainly resample) on audio samples
that do not come from a file.

Does anybody know a HowTo that explains this?
Or can someone write the order of the functions that I have to call?

Thanks in advance for your help
Benjamin

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: libsox audio chain help

Michael Chapman-4
On Wednesday 14 October 2009 2:28 pm, you wrote:
> What I have to do is to use sox's effects (mainly resample) on audio
> samples that do not come from a file.

O.K.
But where do they come from?

Any input is going to be / is going to end up digitised. Unless you need to
do whatever it is in realtime, you can make it a file ...

I have obviously missed something ...

Michael

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: libsox audio chain help

Benjamin-63
Michael Chapman schrieb:

> On Wednesday 14 October 2009 2:28 pm, you wrote:
>> What I have to do is to use sox's effects (mainly resample) on audio
>> samples that do not come from a file.
>
> O.K.
> But where do they come from?
>
> Any input is going to be / is going to end up digitised. Unless you need to
> do whatever it is in realtime, you can make it a file ...
>
> I have obviously missed something ...
>
> Michael
>

I could write a temporary file. And then I wouldn't have to use the library,
but could simply call the sox executable.
But the temp file(s) would become really big, and I don't want to have it
that way.
I want to write a class that can be used from different parts in my program.
The class should take samples, process them in an meaningful way and then
return samples :)

Best regards
Benjamin

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: libsox audio chain help

Chris Bagwell
Give src/example1.c included with SoX source code a look.  If you study input_drain(), you should get a feel for how to feed samples into effects chain without actually reading them from a file.

Hint:  First effect in chain is the input and so is always draining.  Just feed in your samples into effects buffer as needed.

It means your program must be event driven as effects engine consumes samples instead of you driving effects engine when you get samples.

Chris

On Wed, Oct 14, 2009 at 10:40 AM, Benjamin <[hidden email]> wrote:
Michael Chapman schrieb:
> On Wednesday 14 October 2009 2:28 pm, you wrote:
>> What I have to do is to use sox's effects (mainly resample) on audio
>> samples that do not come from a file.
>
> O.K.
> But where do they come from?
>
> Any input is going to be / is going to end up digitised. Unless you need to
> do whatever it is in realtime, you can make it a file ...
>
> I have obviously missed something ...
>
> Michael
>

I could write a temporary file. And then I wouldn't have to use the library,
but could simply call the sox executable.
But the temp file(s) would become really big, and I don't want to have it
that way.
I want to write a class that can be used from different parts in my program.
The class should take samples, process them in an meaningful way and then
return samples :)

Best regards
Benjamin


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: libsox audio chain help

Benjamin-63
Thanks for your suggestion! I think I understood how it works now :-)

This is perfect for multi-threading since I can write an effect that pulls
from a buffer (and waits if nothing is there to pull).

Kind regards
Benjamin


Chris Bagwell schrieb:

> Give src/example1.c included with SoX source code a look.  If you study
> input_drain(), you should get a feel for how to feed samples into
> effects chain without actually reading them from a file.
>
> Hint:  First effect in chain is the input and so is always draining.
> Just feed in your samples into effects buffer as needed.
>
> It means your program must be event driven as effects engine consumes
> samples instead of you driving effects engine when you get samples.
>
> Chris
>


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users