Programming KDEArts, how?

Jorge j.windmeisser at elogix.info
Sat Dec 13 01:29:23 GMT 2003


Am Mittwoch, 10. Dezember 2003 18.14 schrieb Arnold Krille:
> Mailed in private...

Hi Arnold,

I've looked into it, and "I" have coded this:

     KArtsDispatcher *dispatcher = new KArtsDispatcher( 0 );
     KArtsServer *server = new KArtsServer( 0 );
     KAudioPlayStream *m_playStream = new KAudioPlayStream( server, 
"KIsdnmonitor::Out", server );
     connect( m_playStream, SIGNAL( requestData( QByteArray& ) ), sockData, 
SLOT( getData( QByteArray& ) ) );
     m_playStream->start( 8012, 8, 1 ); 

As a result, I get two little pffts and the program goes into an endless loop. 
The QByteArray is filled with data.

The "getData" function is as follows:

bool Kimsocket::getData( QByteArray &data )
     {
     string buffer;
     char out_val;
     int out_int;
//     cout << "datasize=" << data.size() << "\n"; 
     if ( getData( buffer, data.size() ) )
        {
        for (int index = 0; index < data.size(); index++)
            {
            out_int = mulaw[(unsigned char)buffer.c_str()[index]]; 
            out_int = out_int >> 8;        /* rescale for 8 bit values */
            out_val = out_int+128;         /* convert to .WAV format */
            buffer[index] = out_val;     /* write the output byte */
//            i++;
            }

        data.duplicate( buffer.c_str(), buffer.length() );
//        cout << "DATA=" << data << "\n";
        return true;
        }
     return false;
     }

What I'm doing wrong? Any advice?

Thank you in advance, Jorge

> Arnold

-- 
eLogix
Lauigrund
6354 Vitznau

Switzerland

www.elogix.info or www.elogix.ch



More information about the kde-multimedia mailing list