Human speech can function the same way. If Alice hears Bob say “The light was red,” Alice may not testify to this to prove that the light was actually red (unless it falls within one of the many exceptions to the hearsay rule). Bob himself must be called to the stand. But she may testify to Bob’s statement in order to prove that Bob speaks English, or that Bob was present, or that Bob was alive at the time. Similar to the donkey braying, speech conveys truths other than its factual assertions.
Along the lines of the donkey bray, one category of nonhearsay speech is known as a “speech act.” This is speech that has a legal effect, rather than a truth value – much like magic words or incantations. If someone says “I do!” at his wedding, makes or accepts an offer for a contract, or gives an order to a subordinate, this speech is not “true” or “false” in the declarative sense, but it has an effect on the world. Laws themselves are speech acts (including the hearsay rule), but there are many verbalizations that are agreed to have a particular effect on the world aside from truth value.