hts_engine API

Open JTalk のバックエンド。

http://sourceforge.net/projects/hts-engine/

  • 2011-12-25 に 1.06 がリリースされた。(Open JTalk 1.05 と同時)
    • lib/HTS_audio.c で #ifdef AUDIO_PLAY_NONE の処理が追加されている。
  • 2011-07-07 に 1.05 がリリースされた。(Open JTalk 1.04 と同時)
    • 1.05 から PortAudio での出力に対応している。

nvdajp で使っているバージョンはこちら:

変更記録

  • 2011-10-15 バージョン 1.05 を import した。

NVDA版パッチ

since 2012-07-12

HTS_engine_API 1.06 ベースで作業中。これを導入するときには JTalk のドライバも変更が必要(HTS_Audioのサイズが0でなくなる):

libopenjtalk

*** hts_org/include/HTS_engine.h        2011-12-20 13:16:05.000000000 +0900
--- htsengineapi/include/HTS_engine.h   2012-07-12 17:04:19.000000000 +0900
***************
*** 95,100 ****
--- 95,101 ----
  
  /*  -------------------------- audio ------------------------------  */
  
+ #if 0
  #if !defined(AUDIO_PLAY_WINCE) && !defined(AUDIO_PLAY_WIN32) && !defined(AUDIO_PLAY_PORTAUDIO) && !defined(AUDIO_PLAY_NONE)
  #if defined(__WINCE__) || defined(_WINCE) || defined(_WINCE) || defined(__WINCE)
  #define AUDIO_PLAY_WINCE
***************
*** 104,109 ****
--- 105,113 ----
  #define AUDIO_PLAY_NONE
  #endif                          /* WINCE || WIN32 */
  #endif                          /* !AUDIO_PLAY_WINCE && !AUDIO_PLAY_WIN32 && !AUDIO_PLAY_PORTAUDIO && !AUDIO_PLAY_NONE */
+ #else
+ #define AUDIO_PLAY_NONE
+ #endif
  
  /* HTS_Audio: audio output for Windows */
  #if defined (AUDIO_PLAY_WIN32) || defined(AUDIO_PLAY_WINCE)
***************
*** 141,147 ****
  /* HTS_Audio: dummy audio output */
  #ifdef AUDIO_PLAY_NONE
  typedef struct _HTS_Audio {
!    int i;                       /* make compiler happy */
  } HTS_Audio;
  #endif                          /* AUDIO_PLAY_NONE */
  
--- 145,151 ----
  /* HTS_Audio: dummy audio output */
  #ifdef AUDIO_PLAY_NONE
  typedef struct _HTS_Audio {
!    void *p /* int i */;                       /* make compiler happy */
  } HTS_Audio;
  #endif                          /* AUDIO_PLAY_NONE */
  
***************
*** 572,578 ****
  void HTS_GStreamSet_initialize(HTS_GStreamSet * gss);
  
  /* HTS_GStreamSet_create: generate speech */
! HTS_Boolean HTS_GStreamSet_create(HTS_GStreamSet * gss, HTS_PStreamSet * pss, int stage, HTS_Boolean use_log_gain, int sampling_rate, int fperiod, double alpha, double beta, HTS_Boolean * stop, double volume, HTS_Audio * audio);
  
  /* HTS_GStreamSet_get_total_nsample: get total number of sample */
  int HTS_GStreamSet_get_total_nsample(HTS_GStreamSet * gss);
--- 576,582 ----
  void HTS_GStreamSet_initialize(HTS_GStreamSet * gss);
  
  /* HTS_GStreamSet_create: generate speech */
! HTS_Boolean HTS_GStreamSet_create(HTS_GStreamSet * gss, HTS_PStreamSet * pss, int stage, HTS_Boolean use_log_gain, int sampling_rate, int fperiod, double alpha, double beta, HTS_Boolean * stop, double volume, HTS_Audio * audio, double lf0_offset, double lf0_amp);
  
  /* HTS_GStreamSet_get_total_nsample: get total number of sample */
  int HTS_GStreamSet_get_total_nsample(HTS_GStreamSet * gss);
***************
*** 621,626 ****
--- 625,632 ----
     HTS_SStreamSet sss;          /* set of state streams */
     HTS_PStreamSet pss;          /* set of PDF streams */
     HTS_GStreamSet gss;          /* set of generated parameter streams */
+    double lf0_offset;           /* lf0 offset */
+    double lf0_amp;              /* lf0 amp */
  } HTS_Engine;
  
  /*  ----------------------- engine method -------------------------  */
***************
*** 763,768 ****
--- 769,777 ----
  /* HTS_Engine_clear: free engine */
  void HTS_Engine_clear(HTS_Engine * engine);
  
+ /* HTS_Engine_set_lf0_offset: set lf0 offset */
+ void HTS_Engine_set_lf0_offset_amp(HTS_Engine * engine, double offset, double amp);
+ 
  /*  -------------------------- vocoder ----------------------------  */
  
  /* HTS_Vocoder: structure for setting of vocoder */
*** hts_org/lib/HTS_engine.c	2011-12-20 11:11:29.000000000 +0900
--- htsengineapi/lib/HTS_engine.c	2012-07-12 17:01:37.000000000 +0900
***************
*** 472,478 ****
  /* HTS_Engine_create_gstream: synthesis speech */
  HTS_Boolean HTS_Engine_create_gstream(HTS_Engine * engine)
  {
!    return HTS_GStreamSet_create(&engine->gss, &engine->pss, engine->global.stage, engine->global.use_log_gain, engine->global.sampling_rate, engine->global.fperiod, engine->global.alpha, engine->global.beta, &engine->global.stop, engine->global.volume, engine->global.audio_buff_size > 0 ? &engine->audio : NULL);
  }
  
  /* HTS_Engine_save_information: output trace information */
--- 472,479 ----
  /* HTS_Engine_create_gstream: synthesis speech */
  HTS_Boolean HTS_Engine_create_gstream(HTS_Engine * engine)
  {
!    return HTS_GStreamSet_create(&engine->gss, &engine->pss, engine->global.stage, engine->global.use_log_gain, engine->global.sampling_rate, engine->global.fperiod, engine->global.alpha, engine->global.beta, &engine->global.stop, engine->global.volume, engine->global.audio_buff_size > 0 ? &engine->audio : NULL, engine->lf0_offset, engine->lf0_amp);
  }
  
  /* HTS_Engine_save_information: output trace information */
***************
*** 759,764 ****
--- 760,771 ----
     return;
  }
  
+ /* HTS_Engine_set_lf0_offset: set lf0 offset */
+ void HTS_Engine_set_lf0_offset_amp(HTS_Engine * engine, double offset, double amp)
+ {
+     engine->lf0_offset = offset;
+     engine->lf0_amp = amp;
+ }
  HTS_ENGINE_C_END;
  
  #endif                          /* !HTS_ENGINE_C */
project/htsengineapi.txt · 最終更新: 2012/07/12 17:49 by Takuya Nishimoto
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0