1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
   | #include <iostream>
#include <set>
#include <ag/AGAPI.h>
using namespace std;
 
int main()
{
  AGSetId agsetId = CreateAGSet("TIMIT");
 
  TimelineId timelineId = CreateTimeline(agsetId);
 
  SignalId signalId2 = CreateSignal(timelineId,
                                    "LDC93S1:train/dr1/fjsp0/sa1.wav",
                                    "audio",
                                    "wav",
                                    "wav",
                                    "16kHz",
                                    "2");
  set<SignalId> signalIds;
  signalIds.insert(signalId2);
 
  AGId agId = CreateAG(agsetId, timelineId);
  SetFeature(agId, "Purpose", "Testing");
 
  AnchorId anchor1 = CreateAnchor(agId, 10, "sec", signalIds);
  AnchorId anchor2 = CreateAnchor(agId, 20, "sec", signalIds);
  AnchorId anchor3 = CreateAnchor(agId, 30, "sec", signalIds);
 
  AnnotationId annotation1 = CreateAnnotation(agId, anchor1, anchor2, "sentence");
  AnnotationId annotation2 = CreateAnnotation(agId, anchor2, anchor3, "sentence");
 
  SetFeature(annotation1,"label","He will walk to the store.");
  SetFeature(annotation2,"label","He will be walking.");
 
  cout << toXML(agsetId);
} |