Vuo  2.3.2
VuoAudioFrame.c
Go to the documentation of this file.
1 
10 #include "type.h"
11 #include "VuoAudioFrame.h"
12 
14 #ifdef VUO_COMPILER
16  "title" : "Audio Frame",
17  "description" : "VuoAudioSamples and timestamp for a single frame of audio.",
18  "keywords" : [ ],
19  "version" : "1.0.0",
20  "dependencies" : [
21  "VuoAudioSamples",
22  "VuoList_VuoAudioSamples",
23  "VuoReal"
24  ]
25  });
26 #endif
28 
40 {
41  return (VuoAudioFrame){
42  VuoJson_getObjectValue(VuoList_VuoAudioSamples, js, "channels", NULL),
43  VuoJson_getObjectValue(VuoReal, js, "timestamp", 0),
44  };
45 }
46 
51 {
52  json_object *js = json_object_new_object();
53 
54  json_object *channelsObject = VuoList_VuoAudioSamples_getJson(value.channels);
55  json_object_object_add(js, "channels", channelsObject);
56 
57  json_object *timestampObject = VuoReal_getJson(value.timestamp);
58  json_object_object_add(js, "timestamp", timestampObject);
59 
60  return js;
61 }
62 
67 {
68  return VuoText_format("%s<br />Timestamp: <tt>%.3f</tt> seconds", VuoList_VuoAudioSamples_getSummary(value.channels), value.timestamp );
69 }
70 
75 {
76  return fabs(value1.timestamp - value2.timestamp) < .001;
77 }
78 
84 {
85  return a.timestamp < b.timestamp;
86 }