Bugs fixed with sound classification.
authorFrancoisGrondin <francois.grondin2@usherbrooke.ca>
Thu, 19 Oct 2017 19:08:02 +0000 (15:08 -0400)
committerFrancoisGrondin <francois.grondin2@usherbrooke.ca>
Thu, 19 Oct 2017 19:08:02 +0000 (15:08 -0400)
config/azimut_cma.cfg
config/azimut_oma.cfg
config/respeaker.cfg
config/xmos.cfg
demo/parameters.c
src/sink/snk_categories.c

index 3206bad19583e5f7c0b7ecdbbd4e039e8689dd1a..83098e5a52f18de9d1a104dfab28c97c55582831 100644 (file)
@@ -365,6 +365,7 @@ classify:
     alpha = 0.3;
     gamma = 0.05;
     phiMin = 0.15;
+    r0 = 0.2;    
 
     category: {
 
index d4f02c65ea1b48cfa810d22ed733d4eb6a3d6648..5dcba479882cbae4f9a4e3f02f6b39099d65f7d1 100644 (file)
@@ -365,13 +365,14 @@ classify:
     alpha = 0.3;
     gamma = 0.05;
     phiMin = 0.15;
+    r0 = 0.2;
 
     category: {
 
         format = "json";
 
         interface: {
-            type = "blackhole";
+            type = "terminal";
         }
 
     }
index 17fe52f83c12ec037a150c2aa9a214610ffcacb5..6c9146afa24edc74b91410b06fe5063976947fa7 100644 (file)
@@ -294,6 +294,7 @@ classify:
     alpha = 0.3;
     gamma = 0.05;
     phiMin = 0.15;
+    r0 = 0.2;    
 
     category: {
 
index 1348aa2717f1cea5f2301315537e39ba8ef4b988..230fdd370d271f35079bdcb55317aef51a2242d2 100644 (file)
@@ -293,6 +293,7 @@ classify:
     alpha = 0.3;
     gamma = 0.05;
     phiMin = 0.5;
+    r0 = 0.2;    
 
     category: {
 
index d1baaeab24091d1bc3573f8312ac8cc2acd9421c..627bb595fbad6ffaaa349c3f44720b198d876815 100644 (file)
 
             cfg->phiMin = parameters_lookup_float(fileConfig, "classify.phiMin");
 
+        // +----------------------------------------------------------+
+        // | r0                                                       |
+        // +----------------------------------------------------------+           
+
+            cfg->r0 = parameters_lookup_float(fileConfig, "classify.r0");
+
         return cfg;
 
     }
index 25e429c95fddb8d5e5d090f1636eb865eddd80cd..788aa384b26a1d198ea430c6e346e89b1c386ec3 100644 (file)
 
     int snk_categories_process_terminal(snk_categories_obj * obj) {
 
+        int rtnValue;
+        unsigned int iChannel;
+
+        if (obj->in->timeStamp != 0) {
+
+            switch(obj->format->type) {
+
+                case format_text_json:
+
+                    printf("{\n");
+                    printf("    \"timeStamp\": %llu,\n",obj->in->timeStamp);
+                    printf("    \"src\": [\n");
+
+                    for (iChannel = 0; iChannel < obj->nChannels; iChannel++) {
+
+                        switch(obj->in->categories->array[iChannel]) {
+
+                            case 0x01:
+
+                                printf("        { \"category\": \"speech\" }");
+
+                            break;
+
+                            case 0x02:
+
+                                printf("        { \"category\": \"nonspeech\" }");
+
+                            break;
+
+                            default:
+
+                                printf("        { \"category\": \"undefined\" }");
+
+                            break;
+
+                        }
+
+                        if (iChannel != (obj->nChannels - 1)) {
+
+                            printf(",");
+
+                        }
+
+                        printf("\n");
+
+                    }
+                    
+                    printf("    ]\n");
+                    printf("}\n");
+
+                    rtnValue = 0;
+
+                break;               
+
+            }
+
+        }
+        else {
+
+            rtnValue = -1;
+
+        }
 
+        return rtnValue;        
 
     }