speechd-discuss
[Top][All Lists]
Advanced

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

[PATCH] Reopen libao device handles when audio parameters change.


From: Trevor Saunders
Subject: [PATCH] Reopen libao device handles when audio parameters change.
Date: Wed, 1 Sep 2010 01:09:08 -0400

Hi,

On Tue, Aug 31, 2010 at 11:04:26PM +0200, Andrei Kholodnyi wrote:
> > Why should how sound icons are played depend on the synth? imho this
> > should go into module_utils.c ?It seems to me that unless an audio
> > backend doesn't support resampling itself we should have the audio
> > system we are using pulse / alsa / libao do the resampling instead of
> > writing our own code to do.
> 
> Hi Trev,
> 
> IMO it is a responsibility of the TTS engine.

why?  that makes no sense, we are asking the module to play a wave file.
There's no reason I can see to involve the synth, if you see a reason to
involve the synth please tell me what it is.

> we have a special type for it called MSGTYPE_SOUND_ICON

yes, I know.

> which is processed by the corresponding synth e.g.
> 
>       case MSGTYPE_SOUND_ICON:
>               {
>                       char *msg = g_strdup_printf("<audio 
> src=\"%s%s\">%s</audio>",
>                                                                               
> EspeakSoundIconFolder, data, data);
>                       result = espeak_Synth(msg, strlen(msg) + 1, 0, 
> POS_CHARACTER, 0,
>                                                                 flags, NULL, 
> NULL);

yes, and this is imho very silly what will happen is that espeak will
take that message, and just turn around and call the call back we gave
espeak for <auido> tags.  Then we implement a function like the <audio>
callback for espeak in each five modules.  Its the same basic function
in five places, and there is other code in the code specific to modules
to deal with sound icons, unless there is some good reason to involve
the synth in sound icons that I can think of we can get rid of a lot of
repeated code by never involving the synth in the sound icon msg type.

> And if synth can not do it, then we should do something like:
>       case MSGTYPE_SOUND_ICON:
>                convertSoundIcon(icon, &track);

 whynot just have the do_sound_icon() function in module_utils.c just
open the sound icon file set the track parameters and play it with
spd_play() we have the code to do this in several places, we can reduce
this to one place.

I may not have time for a day or two, but I should be able to come up
with a patch quickly that takes the synths out of playing sound icons
and gets rid of a *lot* of code.

Trev

> 
> Andrei.
> 
> _______________________________________________
> 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/20100901/efb4dc7d/attachment.pgp>


reply via email to

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