mirror of
https://github.com/linux-speakup/espeakup.git
synced 2026-08-24 00:24:17 +02:00
Select audio mode before initializing espeak.
This commit is contained in:
parent
ec9d8b1ee2
commit
739d79cff8
4 changed files with 13 additions and 2 deletions
6
alsa.c
6
alsa.c
|
|
@ -100,6 +100,11 @@ static int alsa_play_callback(short *audio, int numsamples,
|
|||
return 0;
|
||||
}
|
||||
|
||||
void select_audio_mode(void)
|
||||
{
|
||||
audio_mode = AUDIO_OUTPUT_RETRIEVAL;
|
||||
}
|
||||
|
||||
int init_audio(unsigned int rate)
|
||||
{
|
||||
int rc;
|
||||
|
|
@ -158,7 +163,6 @@ int init_audio(unsigned int rate)
|
|||
if (rc < 0)
|
||||
return sound_error(rc, "unable to set hw parameters");
|
||||
|
||||
audio_mode = AUDIO_OUTPUT_RETRIEVAL;
|
||||
audio_callback = alsa_play_callback;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,12 @@
|
|||
#include "espeakup.h"
|
||||
int init_audio(unsigned int rate)
|
||||
|
||||
void select_audio_mode(void)
|
||||
{
|
||||
audio_mode = AUDIO_OUTPUT_PLAYBACK;
|
||||
}
|
||||
|
||||
int init_audio(unsigned int rate)
|
||||
{
|
||||
audio_callback = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -133,6 +133,7 @@ int main(int argc, char **argv)
|
|||
}
|
||||
|
||||
/* initialize espeak */
|
||||
select_audio_mode();
|
||||
rate = espeak_Initialize(audio_mode, 0, NULL, 0);
|
||||
if (rate < 0) {
|
||||
fprintf(stderr, "Unable to initialize espeak.\n");
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ extern int open_softsynth(void);
|
|||
extern void close_softsynth(void);
|
||||
extern void main_loop(struct synth_t *s);
|
||||
extern void *queue_runner(void *arg);
|
||||
extern void select_audio_mode(void);
|
||||
extern int init_audio(unsigned int rate);
|
||||
extern void lock_audio_mutex(void);
|
||||
extern void unlock_audio_mutex(void);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue