$OpenBSD: patch-src_api_python_speechd_config_config_py_in,v 1.3 2017/05/26 20:43:12 ajacoutot Exp $
Index: src/api/python/speechd_config/config.py.in
--- src/api/python/speechd_config/config.py.in.orig
+++ src/api/python/speechd_config/config.py.in
@@ -147,6 +147,8 @@ def setup_argparse():
         default=False, help=_("Test ALSA audio output"))
     parser.add_argument('--test-pulse', dest='test_pulse', action="store_true",
             default=False, help=_("Test Pulse Audio output"))
+    parser.add_argument('--test-libao', dest='test_libao', action="store_true",
+            default=False, help=_("Test libao output"))
     parser.add_argument('-e', '--espeak', dest='use_espeak_synthesis',
             action="store_true", default=use_espeak_synthesis,
             help=_("Use espeak to synthesize messages"))
@@ -318,6 +320,11 @@ is not installed."""))
         report(_("Testing PULSE sound output"))
         return self.audio_try_play(type='pulse')
 
+    def test_libao(self):
+        """Test libao sound output"""
+        report("Testing libao sound output")
+        return self.audio_try_play(type='libao')
+
     def diagnostics(self, speechd_running = True, output_modules=None,
             audio_output=None):
         """Perform a complete diagnostics"""
@@ -370,6 +377,10 @@ what is wrong)"""), True):
             if self.test_pulse():
                 working_audio += ["pulse"]
 
+        if decide_to_test('libao', "libao sound system", audio_output): 
+            if self.test_libao():
+                working_audio += ["libao"]
+
         report(_("Testing whether Python Speech Dispatcher library is in path and importable"))
         python_speechd_working = self.python_speechd_in_path()
 
@@ -616,7 +627,7 @@ Do you want to keep it?"""), False)
 
         self.default_audio_method = question_with_suggested_answers(
             "Default audio output method",
-            "pulse",
+            "libao",
             ["pulse", "libao", "alsa", "oss", "pulse,alsa"])
 
         default_speech_rate = question(
@@ -780,6 +791,9 @@ def main():
 
     elif options.test_pulse:
         test.audio_try_play(type='pulse')
+
+    elif options.test_libao:
+        test.audio_try_play(type='libao')
 
     elif options.diagnostics:
         ret = test.diagnostics()
