terminal command say produces error

Solution 1:

A little Googling suggests that it's a new problem in 10.8.4. A couple people in this MacRumors forum thread have experienced the same, as has the author of this blog post. No indications as to how to get rid of it however.

I haven't seen any error when testing say, so it may be some combination of hardware that causes it, but if the sound output is as expected, I wouldn't worry too much about it, and it will probably be fixed eventually.

If you're using say in shell scripts and need the Terminal output cleaned up a bit, you could always pipe it through grep: say test | grep -v "MTBEAudioUnitSoundOutput::PropagateProperty Error -10851".

Solution 2:

I'm just piping stderr to /dev/null for now, i.e.:

say test 2>/dev/null

Solution 3:

The error number is a constant named kAudioUnitErr_InvalidPropertyValue

It also shows up when using the NSSpeechSynthesizer API with the new voices in Mountain Lion.

NSString *string = @"Hello World";
NSSpeechSynthesizer *synth = [[NSSpeechSynthesizer alloc] initWithVoice:nil];
[synth startSpeakingString:string];

reference: https://developer.apple.com/library/mac/documentation/AudioUnit/Reference/AUComponentServicesReference/Reference/reference.html#//apple_ref/doc/uid/TP40007291-CH7-SW1