Esempio n. 1
0
        static void Main(string[] args)
        {
            sharedBuffer = Marshal.AllocCoTaskMem(0);

            debugLogCallback     = DebugLog;
            audioCallback        = ReadAudio;
            outputResultCallback = OutputResult;

            set_debug_log_func(debugLogCallback);
            // set_audio_callback(audioCallback);
            set_result_func(outputResultCallback);
            set_log_to_file("julius_log.txt");

            var thread = new Thread(new ThreadStart(() =>
            {
                start(@"../../../../../unity/Assets/StreamingAssets/grammar-kit/grammar/mic.jconf");
                DebugLog("FINISHED");
            }));


            thread.Start();
            Thread.Sleep(100000);
            finish();
            Thread.Sleep(3000);
        }
Esempio n. 2
0
    public static void Begin(string path)
    {
        context = UnitySynchronizationContext.Create();
        clip    = Microphone.Start("", true, ClipLengthSeconds, SamplingRate);

        samplesFromMicrophone = new float[clip.samples * clip.channels];
        samplesInInt16        = new Int16[clip.samples * clip.channels];
        sharedBuffer          = Marshal.AllocCoTaskMem(clip.samples * clip.channels * 2);

        debugLogCallback     = DebugLog;
        audioCallback        = ReadAudio;
        outputResultCallback = OutputResult;

        set_debug_log_func(debugLogCallback);
        set_audio_callback(audioCallback);
        set_result_func(outputResultCallback);
        set_log_to_file("julius_log.txt");

        var thread = new Thread(new ThreadStart(() =>
        {
            start(path);
            DebugLog("Thread Finished");
        }));

        thread.Start();
    }
Esempio n. 3
0
 public MergeConfiguration(MergePageToken pageToken, Guid invocationId, OutputResultDelegate writeResult, ISyncEventLogger eventLogger, IExcludedObjectReporter excludedObjectReporter, PartitionId partitionId) : base(pageToken, invocationId, writeResult, eventLogger, excludedObjectReporter, MergePageToken.Parse(pageToken.ToByteArray()))
 {
     ExTraceGlobals.BackSyncTracer.TraceDebug((long)SyncConfiguration.TraceId, "New MergeConfiguration");
     ExTraceGlobals.BackSyncTracer.TraceDebug <string>((long)SyncConfiguration.TraceId, "pageToken.MergeState = {0}", pageToken.MergeState.ToString());
     if (pageToken.MergeState == MergeState.Start)
     {
         ExTraceGlobals.BackSyncTracer.TraceDebug((long)SyncConfiguration.TraceId, "Update merge state");
         this.PageToken.UpdateMergeState(partitionId);
     }
 }
 protected SyncConfiguration(Guid invocationId, OutputResultDelegate writeResult, ISyncEventLogger eventLogger, IExcludedObjectReporter excludedObjectReporter)
 {
     ExTraceGlobals.BackSyncTracer.TraceDebug((long)SyncConfiguration.TraceId, "New SyncConfiguration");
     ExTraceGlobals.BackSyncTracer.TraceDebug <Guid>((long)SyncConfiguration.TraceId, "invocationId {0}", invocationId);
     this.WriteResult            = writeResult;
     this.EventLogger            = eventLogger;
     this.ExcludedObjectReporter = excludedObjectReporter;
     this.errorSyncObjects       = new Dictionary <SyncObject, Exception>();
     this.InvocationId           = invocationId;
 }
Esempio n. 5
0
        static void Main(string[] args)
        {
            var thread = new Thread(new ThreadStart(() =>
            {
                d = DebugLog;
                r = Result;
                set_debug_log_func(d);
                set_result_func(r);
                initialize(@"C:\Users\chiepomme\Downloads\grammar-kit-4.3.1\grammar-kit-4.3.1\SampleGrammars\fruit\testmic.jconf");
            }));

            thread.Start();

            Thread.Sleep(20000);
            stop();
        }
Esempio n. 6
0
 static extern void set_result_func(OutputResultDelegate outputResult);
 public TenantFullSyncConfiguration(TenantFullSyncPageToken pageToken, Guid invocationId, OutputResultDelegate writeResult, ISyncEventLogger eventLogger, IExcludedObjectReporter excludedObjectReporter, TenantFullSyncPageToken originalToken) : base(pageToken, invocationId, writeResult, eventLogger, excludedObjectReporter, originalToken)
 {
     ExTraceGlobals.BackSyncTracer.TraceDebug((long)SyncConfiguration.TraceId, "New TenantFullSyncConfiguration");
 }
 public TenantFullSyncConfiguration(TenantFullSyncPageToken pageToken, Guid invocationId, OutputResultDelegate writeResult, ISyncEventLogger eventLogger, IExcludedObjectReporter excludedObjectReporter) : this(pageToken, invocationId, writeResult, eventLogger, excludedObjectReporter, TenantFullSyncPageToken.Parse(pageToken.ToByteArray()))
 {
 }
Esempio n. 9
0
 public FullSyncConfiguration(IFullSyncPageToken pageToken, Guid invocationId, OutputResultDelegate writeResult, ISyncEventLogger eventLogger, IExcludedObjectReporter excludedObjectReporter, IFullSyncPageToken originalToken) : base(invocationId, writeResult, eventLogger, excludedObjectReporter)
 {
     ExTraceGlobals.BackSyncTracer.TraceDebug((long)SyncConfiguration.TraceId, "New FullSyncConfiguration");
     this.FullSyncPageToken = pageToken;
     this.originalToken     = originalToken;
 }
 public ObjectFullSyncConfiguration(ObjectFullSyncPageToken pageToken, Guid invocationId, OutputResultDelegate writeResult, ISyncEventLogger eventLogger, IExcludedObjectReporter excludedObjectReporter) : base(pageToken, invocationId, writeResult, eventLogger, excludedObjectReporter, ObjectFullSyncPageToken.Parse(pageToken.ToByteArray()))
 {
     ExTraceGlobals.BackSyncTracer.TraceDebug((long)SyncConfiguration.TraceId, "New ObjectFullSyncConfiguration");
 }
Esempio n. 11
0
 public DirSyncBasedTenantFullSyncConfiguration(TenantFullSyncPageToken pageToken, ExchangeConfigurationUnit tenantFullSyncOrganizationCU, Guid invocationId, OutputResultDelegate writeResult, ISyncEventLogger eventLogger, IExcludedObjectReporter excludedObjectReporter) : base(pageToken.TenantScopedBackSyncCookie, invocationId, writeResult, eventLogger, excludedObjectReporter)
 {
     if (pageToken == null)
     {
         throw new ArgumentNullException("pageToken");
     }
     ExTraceGlobals.BackSyncTracer.TraceDebug((long)SyncConfiguration.TraceId, "New DirSyncBasedTenantFullSyncConfiguration");
     this.FullSyncPageToken = pageToken;
     this.OrganizationCU    = tenantFullSyncOrganizationCU;
 }
 public DirSyncBasedMergeConfiguration(MergePageToken pageToken, ExchangeConfigurationUnit tenantFullSyncOrganizationCU, Guid invocationId, OutputResultDelegate writeResult, ISyncEventLogger eventLogger, IExcludedObjectReporter excludedObjectReporter, PartitionId partitionId) : base(pageToken, tenantFullSyncOrganizationCU, invocationId, writeResult, eventLogger, excludedObjectReporter)
 {
     ExTraceGlobals.BackSyncTracer.TraceDebug((long)SyncConfiguration.TraceId, "New DirSyncBasedMergeConfiguration");
     ExTraceGlobals.BackSyncTracer.TraceDebug <string>((long)SyncConfiguration.TraceId, "pageToken.MergeState = {0}", pageToken.MergeState.ToString());
     if (pageToken.MergeState == MergeState.Start)
     {
         ExTraceGlobals.BackSyncTracer.TraceDebug((long)SyncConfiguration.TraceId, "Update merge state");
         this.PageToken.UpdateMergeState(partitionId);
     }
 }
Esempio n. 13
0
 public TenantRelocationSyncConfiguration(TenantRelocationSyncPageToken pageToken, Guid invocationId, bool isSmallTenant, OutputResultDelegate writeResult, ISyncEventLogger eventLogger) : base(pageToken, invocationId, writeResult, eventLogger, null, TenantRelocationSyncPageToken.Parse(pageToken.ToByteArray()))
 {
     this.isSmallTenant = isSmallTenant;
     ExTraceGlobals.TenantRelocationTracer.TraceDebug <bool>((long)SyncConfiguration.TraceId, "New TenantRelocationSyncConfiguration: isSmallTenant:{0}", this.isSmallTenant);
 }
 public IncrementalSyncConfiguration(BackSyncCookie syncCookie, Guid invocationId, OutputResultDelegate writeResult, ISyncEventLogger eventLogger, IExcludedObjectReporter excludedObjectReporter) : base(invocationId, writeResult, eventLogger, excludedObjectReporter)
 {
     ExTraceGlobals.BackSyncTracer.TraceDebug((long)SyncConfiguration.TraceId, "New IncrementalSyncConfiguration");
     this.syncCookie = syncCookie;
 }