speechd-discuss
[Top][All Lists]
Advanced

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

[PATCH 06/10] Use afplay and libao for playing sound on OS X in dummy


From: Boris Dušek
Subject: [PATCH 06/10] Use afplay and libao for playing sound on OS X in dummy
Date: Mon, 23 Jul 2012 15:24:17 +0200

From: Boris Dus?ek <address@hidden>
To: address@hidden

afplay is command present from Leopard (10.5).

libao is the only audio output module that makes sense on OS X because
it uses Core Audio and does not try to replace it.
---
 src/audio/libao.c   |    4 ++++
 src/modules/dummy.c |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/audio/libao.c b/src/audio/libao.c
index 3c473eb..ce934c6 100644
--- a/src/audio/libao.c
+++ b/src/audio/libao.c
@@ -221,7 +221,11 @@ static void libao_set_loglevel(int level)
 
 static char const *libao_get_playcmd(void)
 {
+#ifdef __APPLE__
+       return "afplay";
+#else
        return NULL;
+#endif
 }
 
 /* Provide the libao backend. */
diff --git a/src/modules/dummy.c b/src/modules/dummy.c
index 6784cb8..c66223f 100644
--- a/src/modules/dummy.c
+++ b/src/modules/dummy.c
@@ -232,9 +232,13 @@ void _dummy_child()
 
 #define PLAY_CMD(cmd) #cmd " " DATADIR "/dummy-message.wav > /dev/null 2> 
/dev/null"
        static const char *const play_cmds[] = {
+#ifdef __APPLE__
+               PLAY_CMD(afplay),
+#else
                PLAY_CMD(play),
                PLAY_CMD(aplay),
                PLAY_CMD(paplay),
+#endif
                NULL
        };
 #undef PLAY_CMD
-- 
1.7.7.5 (Apple Git-26)




reply via email to

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