speechd-discuss
[Top][All Lists]
Advanced

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

tone generation patches


From: Trevor Saunders
Subject: tone generation patches
Date: Thu, 21 Oct 2010 19:21:32 -0400

Hi,

On Thu, Oct 21, 2010 at 05:16:28PM -0500, Christopher Brannon wrote:
> Trevor Saunders <trev.saunders at gmail.com> writes:
> 
> > I took a quick look through your patch, and it looks fine to me.
> > However I wonder why you want to deal with generating tones in each
> > module?  It seems to me like we could just have do_tone() deal with
> > generating the tone and playing it,  and not have to worry about it in
> > each module.
> 
> The actual tone generation will be done in a helper function in
> module_utils.c.  The module_speak function, which is defined once per
> module, will need a case for MSGTYPE_TONE.
> I probably wasn't clear about this in my comments.

yes, that could work but it means that to play a tone you do the
following in module_main() you call do_tone() which then just calls
do_message() with the TONE type, which gets an argument from the server,
then you call module_speak() with that argument and the type, then that
will have a case calling your helper function.

Instead I was proposing that the server sends the arguments to tone on
the same line as the tone command, the same way it sends parameters to
debug, and then do_tone() just parses out the arguments which is trivial
just break the string up on white space, and then plays the tone with
the same code as your helper function.  That seems a lot more direct to
me, and saves us from spewing the same casing code into each module.

Trev

> 



> _______________________________________________
> Speechd mailing list
> Speechd at lists.freebsoft.org
> http://lists.freebsoft.org/mailman/listinfo/speechd

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: 
<http://lists.freebsoft.org/pipermail/speechd/attachments/20101021/5445737a/attachment.pgp>


reply via email to

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