diff options
author | asanoaozora <fifitaneki@hotmail.com> | 2016-12-15 17:37:28 +0100 |
---|---|---|
committer | asanoaozora <fifitaneki@hotmail.com> | 2016-12-15 17:37:28 +0100 |
commit | 3c6e487547e7692fe7e7fd30d4531a496680ee7d (patch) | |
tree | b481a5ae00885fba36c8edff3f61f33ca05f1a3c /src/speech/main.cpp | |
parent | 5620ee809fc37bf862bf504fc9ed5f05e9a12fba (diff) | |
download | poi-service-3c6e487547e7692fe7e7fd30d4531a496680ee7d.tar.gz |
apply patch for layer manager update
Diffstat (limited to 'src/speech/main.cpp')
-rw-r--r-- | src/speech/main.cpp | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/speech/main.cpp b/src/speech/main.cpp index bddada8..261cd5a 100644 --- a/src/speech/main.cpp +++ b/src/speech/main.cpp @@ -2,13 +2,15 @@ * @licence app begin@ * SPDX-License-Identifier: MPL-2.0 * -* \copyright Copyright (C) 2013-2014, PCA Peugeot Citroen +* \copyright Copyright (C) 2013-2017, PCA Peugeot Citroen * * \file main.cpp * * \brief This file is part of the speech proof of concept. * * \author Philippe Colliot <philippe.colliot@mpsa.com> +* \brief Some parts of the code has been inspired by the following people: +* \brief Mario Thielert, David Kämpf, Dominique Massonie * * \version 1.1 * @@ -97,6 +99,22 @@ static std::string m_chunkBuffer; /** max size = MAX_CHUNK_SIZE*MAX_SLOT_COUNT * int last, cst_audio_streaming_info_struct *asi) { printf("\n>>> [server] fliteCallback()\n"); + printf("start: %d size: %d last: %d \n",start,size,last); + static cst_audiodev *ad = 0; + + if (start == 0) + ad = audio_open(w->sample_rate,w->num_channels,CST_AUDIO_LINEAR16); + + audio_write(ad,&w->samples[start],size*sizeof(short)); + + if (last == 1) + { + audio_close(ad); + ad = NULL; + } + + /* if you want to stop return CST_AUDIO_STREAM_STOP */ + return CST_AUDIO_STREAM_CONT; } class SpeechOutputServerStub @@ -117,11 +135,11 @@ public: flite_init(); mp_voice = register_cmu_us_kal(NULL); -/* mp_asi = new_audio_streaming_info(); + mp_asi = new_audio_streaming_info(); mp_asi->asc = fliteCallback; feat_set(mp_voice->features,"streaming_info",audio_streaming_info_val(mp_asi)); -*/ + } ~SpeechOutputServerStub() { |