More efficient way to retrieve data from JSON
There are a few issues with getTextFromJSON involving use of pointers, code
duplication and use of an inappropriate function.

Pointers first.  In this code:

jsontok_t tokens[15];
jsontok_t key;
...
key = tokens[i];


you are copying the token when you could be using a pointer:

jsontok_t *key = &amp;tokens[i];


Copying is obviously more costly than pointing.  Also note that it is often
best to define the variable at its first point of use.



There are two points of duplication, one determining the size of the token
array and one concerned with copying the string.  Instead of this:

jsontok_t tokens[15];
...
parseJson(&amp;p, json, tokens, sizeof(tokens) / sizeof(tokens[0]));
for(unsigned int i = 0; i &lt; sizeof(tokens) / sizeof(tokens[0]); ++i)


I would do either:

#define N_TOKENS 15
jsontok_t tokens[N_TOKENS];
...
parseJson(&amp;p, json, tokens, N_TOKENS);
for(unsigned int i = 0; i &lt; N_TOKENS; ++i)


or 

jsontok_t tokens[15];
#define N_TOKENS (sizeof tokens / sizeof tokens[0])  // or const int N_TOKENS inseatd of #define 
...etc 


The string copying code-duplication is actually unnecessary if you use a
better standard library function...



Instead of using strcmp to compare the string (which involves constructing
the string because it lacks a \0):

    if(!strcmp(keyString, "utterance"))


use memcmp.  And you can use strndup to create a copy of the key.  If you
don't have strndup which is non-standard, you can easily write it (in a
separate function).

These changes wont speed it up much, but are certainly cleaner:

char* getTextFromJSON(const char *json)
{
    if (!json) return NULL;

    json_parser p;
    #define N_TOKENS 15  // this normally would be at the start of the file
    jsontok_t tokens[N_TOKENS];

    initJsonParser(&amp;p);
    int n = parseJson(&amp;p, json, tokens, N_TOKENS);
    for (int i = 0; i &lt; n; ++i) {
        jsontok_t *key = &amp;tokens[i];
        if (!memcmp("utterance", &amp;json[key-&gt;start], (size_t) (key-&gt;end - key-&gt;start))) {
            ++key;
            return strndup(&amp;json[key-&gt;start], (size_t)(key-&gt;end - key-&gt;start));
        }
    }
    return NULL;
}