On 03/09/2018 08:09 PM, fredvs wrote:
>> Are you sure that the program still is OK with your changes? 
> 
> Ok, re-re-re checked.
> 
> With forced: 
>  ch1on.value := true;
>  ch2on.value := true;
>  twochannel:= true;
>  channels := 2;
> 
>  and audio_object_write(faudioobj,p1,bytelen div channels) 
> 
> And with sleep(100) after wavethread.terminate() :
> 
> ---> With those changes, yes the sound of the stereo sine-wave is perfect,
> 
The problem with the wrong buffer length is in pcaudiolib/source/src/alsa.c
"
int
alsa_object_open(struct audio_object *object,
                 enum audio_object_format format,
                 uint32_t rate,
                 uint8_t channels)
{
        struct alsa_object *self = to_alsa_object(object);
        if (self->handle)
                return -EEXIST;

        snd_pcm_format_t pcm_format;
#define FORMAT(srcfmt, dstfmt, size) case srcfmt: pcm_format = dstfmt;
self->sample_size = size; break;
"
It probably should be
"
#define FORMAT(srcfmt, dstfmt, size) case srcfmt: pcm_format = dstfmt;
self->sample_size = size*channels; break;
"

There are more problems with pcaudiolib alsa driver because it is not
synchronous as the Windows and the Pulseaudio driver. It probably
doesn't care for eSpeak-ng because eSpeak-ng does internal timing but by
feeding the audio data as fast as possible by the sine wave generator
there are problems.

Suggestion: use Pulseaudio or change the pcaudiolib alsa driver to use
an overlapping buffer pattern like in waveout.c.

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to