Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void ts3plugin_onEditPlaybackVoiceDataEvent(uint64 serverConnectionHandlerID, anyID clientID, short* samples, int sampleCount, int channels) {
- // todo:
- // - handle endianess
- // - add packet sequence number
- // - handle overflow (maybe)
- int sampleLen = sampleCount * sizeof(short) * channels;
- int bufLen = 1 + sampleLen;
- char *buf = (char *)malloc(bufLen);
- if (buf != NULL) {
- buf[0] = channels;
- memcpy(buf + 1, (char *)samples, sampleLen);
- sendto(sock, (char *)buf, bufLen, 0, (struct sockaddr *)&serverAddr, sizeof(serverAddr));
- free(buf);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement