diff options
Diffstat (limited to 'apps/playback.c')
-rw-r--r-- | apps/playback.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/apps/playback.c b/apps/playback.c index c74c606016..fe9bd579d4 100644 --- a/apps/playback.c +++ b/apps/playback.c | |||
@@ -738,7 +738,7 @@ static void audio_reset_buffer(void) | |||
738 | { | 738 | { |
739 | /* | 739 | /* |
740 | * Layout audio buffer as follows: | 740 | * Layout audio buffer as follows: |
741 | * [[|TALK]|SCRATCH|BUFFERING|PCM|] | 741 | * [[|TALK]|SCRATCH|BUFFERING|PCM|[VOICE|]] |
742 | */ | 742 | */ |
743 | 743 | ||
744 | /* see audio_get_recording_buffer if this is modified */ | 744 | /* see audio_get_recording_buffer if this is modified */ |
@@ -755,6 +755,18 @@ static void audio_reset_buffer(void) | |||
755 | 755 | ||
756 | ALIGN_BUFFER(filebuf, filebuflen, sizeof (intptr_t)); | 756 | ALIGN_BUFFER(filebuf, filebuflen, sizeof (intptr_t)); |
757 | 757 | ||
758 | if (talk_voice_required()) | ||
759 | { | ||
760 | /* Need a space for voice PCM output */ | ||
761 | allocsize = voicebuf_init(filebuf + filebuflen); | ||
762 | |||
763 | allocsize = ALIGN_UP(allocsize, sizeof (intptr_t)); | ||
764 | if (allocsize > filebuflen) | ||
765 | goto bufpanic; | ||
766 | |||
767 | filebuflen -= allocsize; | ||
768 | } | ||
769 | |||
758 | /* Subtract whatever the pcm buffer says it used plus the guard buffer */ | 770 | /* Subtract whatever the pcm buffer says it used plus the guard buffer */ |
759 | allocsize = pcmbuf_init(filebuf + filebuflen); | 771 | allocsize = pcmbuf_init(filebuf + filebuflen); |
760 | 772 | ||
@@ -3475,7 +3487,7 @@ unsigned char * audio_get_buffer(bool talk_buf, size_t *buffer_size) | |||
3475 | swap space */ | 3487 | swap space */ |
3476 | logf("get buffer: audio"); | 3488 | logf("get buffer: audio"); |
3477 | buf = audiobuf + talk_get_bufsize(); | 3489 | buf = audiobuf + talk_get_bufsize(); |
3478 | end = audiobufend - pcmbuf_init(audiobufend); | 3490 | end = audiobufend - voicebuf_init(audiobufend); |
3479 | buffer_state = AUDIOBUF_STATE_VOICED_ONLY; | 3491 | buffer_state = AUDIOBUF_STATE_VOICED_ONLY; |
3480 | } | 3492 | } |
3481 | 3493 | ||