Reputation: 1176
I am trying to stream microphone input from my Symbian device (Nokia N8) to a PureData application running on my Windows PC. Both are connected via WiFi.
The connection is successful, but reading the incoming data fails. When I use TCP, the connection drops immediately with the little helpful
netreceive~: recv data: Unknown error (10014).
With UDP, I get lots of
netreceive~: recv data: Message too long (10040).
I have set the sample rate in PD to match the one coming from the phone, but PD keeps telling me that the audio format is unknown. Maybe it has to do with the sample size, or byte order?
P.S.: I am using Olaf Matthes' netreceive~ object on the PD side, and the Qt code looks like this:
audio_out_socket = new QTcpSocket(this);
audio_out_socket->connectToHost(pdclient_addr, 8030);
QAudioDeviceInfo info = QAudioDeviceInfo::defaultInputDevice();
QAudioFormat format = info.preferredFormat();
audio_in = new QAudioInput(info, format, this);
audio_in->start(audio_out_socket);
Upvotes: 0
Views: 616
Reputation: 31274
[netreceive~]
expects a "header" that holds information about the data before the actual data arrives.
from netsend~.h:
typedef struct _tag { /* size (bytes) */
char version; /* 1 */
char format; /* 1 */
long count; /* 4 */
char channels; /* 1 */
long framesize; /* 4 */
char extension[5]; /* 5 */
} t_tag; /*--------------*/
/* 16 */
extension
seems to be currently unused, but you have to fill out the rest, according to the data you are sending (check this header-file for more info)
Upvotes: 1