Fix a problem that caused stale pcm data to be played subsequent to a

voice shutup.

Observed when moving through a few voiced items in very quick succession.

This is for the case where music playback is not in progress, only voice
is playing.  The first few samples of audio data for voicing the first
skipped item make it to the pcm buffer, but the shutup comes before
enough pcm data has accumulated to actually start pcm playback. The
condition at the top of voice_on_voice_stop() is therefore false,
pcmbuf_play_stop() is not called, and the beginning of the interrupted
utterance is left to wait in the pcm buffer. That data will end up
prepended to the following voice clip to be played, causing a kind of
stuttering effect.

The fix is to remove the condition on pcm_is_playing() in
voice_on_voice_stop(): always clear the pcm data, it's harmless if there
wasn't any.

Thanks to jhMikeS for his assistance.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15176 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Stéphane Doyon 2007-10-18 00:17:15 +00:00
parent 1cca3ceeef
commit e5ba649d85

View file

@ -1130,7 +1130,7 @@ static size_t voice_filebuf_callback(void *ptr, size_t size)
/* Handle Q_VOICE_STOP and part of SYS_USB_CONNECTED */
static bool voice_on_voice_stop(bool aborting, size_t *realsize)
{
if (aborting && !playing && pcm_is_playing())
if (aborting && !playing)
{
/* Aborting: Slight hack - flush PCM buffer if
only being used for voice */