- 授权协议: ISC
- 开发语言: C/C++
- 操作系统: 跨平台
- 软件首页: https://github.com/mhroth/tinyosc
软件介绍
TinyOSC 是极其简单的 Open Sound Control (OSC) 库,使用 C 编写,常用示例是解析直接从一个 socket 接收的原生缓冲。
代码示例:
#include "tinyosc.h" tosc_tinyosc osc; // declare the TinyOSC structure char buffer[1024]; // declare a buffer into which to read the socket contents int len = 0; // the number of bytes read from the socket while ((len = READ_BYTES_FROM_SOCKET(buffer)) > 0) { // parse the buffer contents (the raw OSC bytes) // a return value of 0 indicates no error if (!tosc_init(&osc, buffer, len)) { printf("Received OSC message: [%i bytes] %s %s ", len, // the number of bytes in the OSC message osc.address, // the OSC address string, e.g. "/button1" osc.format); // the OSC format string, e.g. "f" for (int i = 0; osc.format[i] != '\0'; i++) { switch (osc.format[i]) { case 'f': printf("%g ", tosc_getNextFloat(&osc)); break; case 'i': printf("%i ", tosc_getNextInt32(&osc)); break; case 's': printf("%s ", tosc_getNextString(&osc)); break; default: continue; } } printf("\n"); } }
为你推荐:
超简单!一学就懂的互联网金融
视觉图文 / 人民邮电出版社 / 2015-2-1 / 45.00元
零基础、全图解,通过130多个精辟的知识点、220多张通俗易懂的逻辑图表,让您一书在手,即可彻底看懂、玩转互联网金融从菜鸟成为达人,从新手成为互联网金融高手! 本书主要特色:最简洁的版式+最直观的图解+最实用的内容。 本书细节特色:10章专题内容详解+80多个特别提醒奉献+130多个知识点讲解+220多张图片全程图解,深度剖析互联网金融的精华之处,帮助读者在最短的时间内掌握互联网金融知......一起来看看 《超简单!一学就懂的互联网金融》 这本书的介绍吧!