[speex-dev] Speex wrapper functions for Visual Basic

=?iso-8859-1?Q? spontexx at web.de
Tue Feb 17 02:55:35 PST 2004



Hello,

i want to use speex out of visual basic. So i have written a few wrapper functions in VC++ (v6) wich i can call from VB (v6). But i have problems with the encode and decode functions.

Encode wrapper Function:
I want to copy the value of an single array in VB to a float array in C which can be 
encoded. And the output of the encoder have to be unsigned char because in VB its an 
byte array.

Here are my first steps but it don´t work and i don´t come forward. Hopefully someone can help me!

CALL int __stdcall EncodeSpeexFrame (float *input_frame, unsigned char *output_bytes, int input_size)
{

        int MAX_NB_BYTES, nbBytes;

        char *output_buffer;
        unsigned char *temp_buffer;
        float *input_buffer;

        input_buffer = new float (input_size);

        input_buffer = input_frame;

        speex_bits_reset(&enc_bits);

        speex_encode(enc_state, input_buffer, &enc_bits);

        delete input_buffer;

        MAX_NB_BYTES = speex_bits_nbytes(&enc_bits);

        output_buffer = new char (MAX_NB_BYTES);

        nbBytes = speex_bits_write(&enc_bits, output_buffer, MAX_NB_BYTES);

        temp_buffer = new unsigned char (nbBytes);

        temp_buffer = (unsigned char *)output_buffer;

        delete output_buffer;

        output_bytes = temp_buffer;

        delete temp_buffer;

        return nbBytes;
}

Thank you very much in advance.

Best regards
Sören Krings
______________________________________________________________________________
Ein Grund zum Feiern: Die PC Praxis ermittelt zwischen 10 grossen
Mailprovidern WEB.DE FreeMail als Testsieger http://f.web.de/?mc=021190

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'speex-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Speex-dev mailing list