[CLAM] newbie

Agustin Cortés agucortes at gmail.com
Sat Apr 19 17:59:56 PDT 2008


Hi, Hernan... Thank u very much for your help. I go on reading the
clam library and now i understand a much more how it works.
The data type is doble, that its what i meant, because i didn't know
how to process the audio signal...
Now i have another problem, i'm using the cygwin, and i cant install
the library. i don't know how to compile it from the source code. I've
read the file "INSTALL" but i couldn't make it work.
If someone is familiarized with this program (Cygwin), or recomend me
an other compiler for Windows, thats will be nice...
Agustin..
PS: it's true the thing of reply-to..

On Sat, Apr 19, 2008 at 11:47 AM, Hernán Ordiales <h at ordia.com.ar> wrote:
>
> On Thu, Apr 17, 2008 at 2:02 PM, Agustin Cortés <agucortes at gmail.com> wrote:
> > I've read the tutorial, and i have one question...
> >  ----------------------------
> >  #ifndef MyProcessing_hxx
> >  #define MyProcessing_hxx
> >
> >  #include <CLAM/InPort.hxx>
> >  #include <CLAM/OutPort.hxx>
> >  #include <CLAM/Processing.hxx>
> >
> >  // Those two configuration types could be the ones you choose.
> >  // Your own ones or any type already in CLAM.
> >  #include "MyInputDataType.hxx"
> >  #include "MyOutputDataType.hxx"
> >
> >  class MyProcessing : public CLAM::Processing
> >  {
> >         CLAM::InPort<MyInputDataType> mIn;
> >         CLAM::OutPort<MyOutputDataType> mOut;
> >  public:
> >         const char* GetClassName() const { return "MyProcessing"; }
> >         MyProcessing(const Config& config = Config())
> >                 : mIn("My Input", this)
> >                 , mOut("My Output", this)
> >         {
> >                 Configure( config );
> >         }
> >
> >         bool Do()
> >         {
> >                 bool result = Do(mIn.GetData(), mOut.GetData());
> >                 // Tell the ports this is done
> >                 mIn.Consume();
> >                 mOut.Produce();
> >                 return result;
> >         }
> >
> >         bool Do(const MyInputDataType& in, MyOutputDataType& out)
> >         {
> >                 // Your implementation
> >         }
> >  ------------------
> >  What kind of Type of Data is "MyInputDataType", i mean, what i read
> >  from the audio from a mic, what kind of data is? is Audio? How do i
> >  analyze data from that class?
> >  Thanks..
> >  Agustin
>
> Hi Agustín! (btw, remember to answer to clam at iua.upf.edu not private mails[1])
>
> could be many things, audio, fundamental, peaks, depends on your incontrol types
>
> for audio things take a look at the simple AudioAmplifier processing
> (CLAM/src/Processing/ArithOps/AudioAmplifier.hxx)
>
>                /** Ports **/
>                AudioInPort mInputAudio;
>                AudioOutPort mOutputAudio;
> ...
>                bool Do(const Audio& in, Audio& out)
>                {
>                        int size = in.GetSize();
>
>                        TData gain = mInputControl.GetLastValue();
>
>                        TData* inb = in.GetBuffer().GetPtr();
>                        TData* outb = out.GetBuffer().GetPtr();
>
>                        for (int i=0;i<size;i++)
>                        {
>                                *outb++ = (*inb++)*gain;
>                        }
>
>                        return true;
>                }
>
> if you dislike pointers this also works:
>                bool Do(const Audio& in, Audio& out)
>                {
>                        int size = in.GetSize();
>
>                        TData gain = mInputControl.GetLastValue();
>
>                        DataArray& inb = in.GetBuffer();
>                        DataArray& outb = out.GetBuffer();
>
>                        for (int i=0;i<size;i++)
>                        {
>                                outb[i] = inb[i]*gain;
>                        }
>
>                        return true;
>                }
>
> cheers
>
> [1] Pau or whoever who is the list admin, i think a 'reply-to' to the
> list config like we have in clam-devel would be also useful here...
> --
>
> Hernán
> http://h.ordia.com.ar
> GnuPG: 0xEE8A3FE9
>




More information about the clam-users mailing list