RPI gravelly speech and pcaudiolib results

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

 



Hi folks: Brandon McGinty and I have been poking around attempting to
fix the gravelly voice on Raspberry PI machines. The effect shows up
on both the 32-bit and 64-bit systems.

It took a bit of experimenting to find what I believe is the correct
fix. The problem appears to be the standard buffer size being handed
off to the audio subsystem finishes playing more quickly on the PIs
causing the speech to not sound smooth giving a gravelly speech
output. In the new espeak-ng and libespeak-ng this is handled by
pcaudiolib instead of port-audio under the older espeak package.

To fix the problem you have to hand over larger buffer of sound to
smooth out the effect. The lines in question are line 103 in
pcaudiolib/src/alsa.c and line 83 in pcaudiolib/src/pulseaudio.c. The
default lines each end with dividing by 1000. I first tried just
removing the / 1000 which smoothed out the speech very nicely but
caused the buffers to be large enough that moving between lines and
words in review mode to have an extremely sluggish response because
the buffer wouldn't flush until it finished speaking it. So I put the
/ 1000 back in and started reducing the value to find the result that
would provide smooth speech but still maintain responsiveness with the
review functions of speakup. What I found worked fairly well was a
division value of 200 which seemed to increase the buffer sizes enough
to give smooth speech and keep the quick feel of moving around.

If you are experiencing gravelly speech I'd appreciate it if you would
try the above changes to see if it resolves the problem. You want to
edit 1000 to 200 on lines 102 of alsa.c and line 83 of pulseaudio.c in
pcaudiolib/src and then recompile. Different distros seem to put their
libraries in various weird and wonderful places so be a tad careful
wheninstalling the new libpcaudio libraries and symlinks. Even the RPI
32-bit and RPI 64-bit stash their libraries in different places.

I hope this helps some folks.

  Kirk





[Index of Archives]     [Linux for the Blind]     [Fedora Discussioin]     [Linux Kernel]     [Yosemite News]     [Big List of Linux Books]

  Powered by Linux