Browse Source

wave_pulse: make use of the device parameter to wave_open

master
Reece H. Dunn 9 years ago
parent
commit
856a4d4bea
1 changed files with 3 additions and 5 deletions
  1. 3
    5
      src/libespeak-ng/wave_pulse.c

+ 3
- 5
src/libespeak-ng/wave_pulse.c View File

} }
} }


static int pulse_open()
static int pulse_open(const char *device)
{ {
pa_sample_spec ss; pa_sample_spec ss;
pa_operation *o = NULL; pa_operation *o = NULL;
a_attr.minreq = MINREQ; a_attr.minreq = MINREQ;
a_attr.fragsize = 0; a_attr.fragsize = 0;


if (pa_stream_connect_playback(stream, NULL, &a_attr, (pa_stream_flags_t)(PA_STREAM_INTERPOLATE_TIMING|PA_STREAM_AUTO_TIMING_UPDATE), NULL, NULL) < 0) {
if (pa_stream_connect_playback(stream, device, &a_attr, (pa_stream_flags_t)(PA_STREAM_INTERPOLATE_TIMING|PA_STREAM_AUTO_TIMING_UPDATE), NULL, NULL) < 0) {
fprintf(stderr, "Failed to connect stream: %s", pa_strerror(pa_context_errno(context))); fprintf(stderr, "Failed to connect stream: %s", pa_strerror(pa_context_errno(context)));
goto unlock_and_fail; goto unlock_and_fail;
} }


void *wave_open(int srate, const char *device) void *wave_open(int srate, const char *device)
{ {
(void)device; // unused

stream = NULL; stream = NULL;
wave_samplerate = srate; wave_samplerate = srate;


if (pulse_open() != PULSE_OK)
if (pulse_open(device) != PULSE_OK)
return NULL; return NULL;


return (void *)1; return (void *)1;

Loading…
Cancel
Save