Vuo  2.0.0
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
27 
40 {
41  return (VuoAudioFrame){
42  VuoJson_getObjectValue(VuoList_VuoAudioSamples, js, "channels", NULL),
43  VuoJson_getObjectValue(VuoReal, js, "timestamp", 0),
44  ""
45  };
46 }
47 
52 {
53  json_object *js = json_object_new_object();
54 
55  json_object *channelsObject = VuoList_VuoAudioSamples_getJson(value.channels);
56  json_object_object_add(js, "channels", channelsObject);
57 
58  json_object *timestampObject = VuoReal_getJson(value.timestamp);
59  json_object_object_add(js, "timestamp", timestampObject);
60 
61  return js;
62 }
63 
68 {
69  return VuoText_format("%s<br />Timestamp: <tt>%.3f</tt> seconds", VuoList_VuoAudioSamples_getSummary(value.channels), value.timestamp );
70 }
71 
76 {
77  // Maybe this should just check image?
78  return abs(value1.timestamp - value2.timestamp) < .001;
79 }
80 
86 {
87  return a.timestamp < b.timestamp;
88 }