speechd-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

sd_generic breaks speech output Ubuntu 10.04


From: Chris Brannon
Subject: sd_generic breaks speech output Ubuntu 10.04
Date: Fri, 30 Apr 2010 08:38:48 -0500

> Any module using sd_generic currently break the
> system. An easy way to reproduce this is to enable the e-speak generic
> module in the speechd.conf and then run speech-dispatcher and orca from
> a terminal. You will get out put like this.

Here's the bug.  Look at src/modules/generic.c, line 389.
This is the code which determines the audio player to use.
The problem is the assertion.
Calling assert with a string will always succeed, because in C, a non-NULL
pointer is always true.
This code does not set play_command correctly when the audio backend is not
one of oss, alsa, or pulse.
Also, if your config file specifies that multiple audio backends can be
used, then the list of backends is not being parsed properly.
E.G., if you have
AudioOutputMethod "pulse,alsa"
then this code will fail to select an audio player.
Here's the code, followed by my proposed quick fix.

                if (!strcmp(audio_settings.audio_output_method, "oss")){
                  play_command = strdup("play");
                }else if (!strcmp(audio_settings.audio_output_method, "alsa")){
                  play_command = strdup("aplay");
                }else if (!strcmp(audio_settings.audio_output_method, "pulse")){
                  play_command = strdup("paplay");
                }else{
                  assert("Unknown audio output method requested");
                }

You could change the assert to something like:
play_command = strdup("play"); /* Use "play" as the default player. */

Hope this helps,
-- Chris



reply via email to

[Prev in Thread] Current Thread [Next in Thread]