0
0

Hi all
i’d like to compress an FSOUND_SAMPLE *ptr using speex
does anyone tryed this? Where can i find infotmations?
i’d like to know how to convert the sample in a suitable way to imput it

to the speex_encode funcion

thanks

  • You must to post comments
0
0

Sorry only for to be more clear, i’d like to do something like this:

     FSOUND_Record_StartSample
                         l
                         l
                Speex_encode
                         l
             ............................. (send over network)
                         l
                Speex_decode
                         l
                         l
            FSOUND_PlaySound

Is it possible? Any suggestion?

  • You must to post comments
0
0

You can setup a DSP callback where you can get raw data ready to be encoded by Speex. See the record sample, there is some code showing how to get raw data.

  • You must to post comments
0
0

Thank u very mutch…
well i’m a newbie with FMOD and sound in general…it’s a little hard for me tu understand that code…i suppose it is simple to get raw data, do i need only FSOUND_DSP_MixBuffers function?

  • You must to post comments
0
0

Well if i understood, i have to do this call:
MyDSPUnit = FSOUND_DSP_Create(&MyDSP_Callback,FSOUND_DSP_DEFAULTPRIORITY_USER+20, 0);

FSOUND_DSP_SetActive(MyDSPUnit, TRUE);

then in the

void * F_CALLBACKAPI MyDSP_Callback(void *originalbuffer, void *newbuffer, int length, int param)
{
short *myRawData = (short *)newbuffer;
SpeexEncodeRoutine(myRawData, Encodeddada);

 return newbuffer;

}

will this schema works? i’ll work with 8bit mono samples, but i’m sure where in the DSP chain put my callback :( ….. FSOUND_DSP_DEFAULTPRIORITY_USER+20 is a good choice???
For 8bit mono samples a cast to short * is safe? nad ho to get the dimension in byte of new buffer???? 😥

I hope i not disturb u….
Thanks anyway
Fabio

  • You must to post comments
0
0

In the fmod player sourcecode, see the OscCallback function 😉

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.