On 13 May 2013 00:34, Jason White <[email protected]> wrote:

> Reece Dunn <[email protected]> wrote:
> > Are you sure the AUDIO=runtime flags are being set during the build?
> >
> > In line 30 of src/Makefile, espeak sets AUDIO=portaudio. This could be
> > overriding the AUDIO setting like CXXFLAGS were being overrided in bug
> > #707925.
> >
> > If AUDIO=runtime is built correctly, both wave.cpp and wave_pulse.cpp
> > should be compiled and -DUSE_PULSEAUDIO -DUSE_PORTAUDIO should be passed
> to
> > the compiler (see lines 37-39).
>
> Yes, indeed, and that's exactly what I see in the output of make during the
> compilation.
>
> It appears that variables specified on the make command line are treated
> differently from those brought in from the environment.
>

Then that should work...

The src/wave.cpp file contains the AUDIO=portaudio and AUDIO=runtime logic
and the src/wave_pulse.cpp file contains the AUDIO=pulse logic.

If both USE_PULSEAUDIO and USE_PORTAUDIO are defined, the wave API is
renamed from wave_xyz to wave_port_xyz for the portaudio bindings
(src/wave.cpp, lines 182-193) and to wave_pulse_xyz for the pulseaudio
bindings (src/wave_pulse.cpp, lines 80-91).

The AUDIO=runtime logic then uses the wave_xyz functions defined in
src/wave.cpp, lines 94-179 that uses either pulseaudio or portaudio.

The wave_init function calls is_pulse_running which returns 1 if calling
pa_simple_new returns a non-NULL pointer. If pulseaudio is running, the
wave_pulse_xyz APIs are called (which will call pa_context_new via
wave_pulse_init/pulse_open) otherwise the wave_port_xyz APIs are called
(which will call Pa_Initialize via wave_port_init).

Thus, with pulseaudio working you shoulds have the calls:
    wave_init
    is_pulse_running
    pa_simple_new
    wave_pulse_init
    pulse_open
    pa_context_new
and with pulseaudio not working, you should have the calls:
    wave_init
    is_pulse_running
    pa_simple_new
    wave_port_init
    Pa_Initialize

Reply via email to