OSDN Git Service

読み取り機能実装途中
[nlite/nlite.git] / speaker / open_jtalk_core.h
1 #pragma once
2
3 #include <queue>
4 namespace speaker{
5 namespace openJtalk{
6         
7         ///
8         ///OpenJtalk\82ð\83\89\83b\83v\82µ\82½\83N\83\89\83X
9         ///\83f\83B\83\8c\83N\83g\83\8a\82Ì\88µ\82¢\82Ì\8aÈ\88Õ\89»\82Æ\83I\83u\83W\83F\83N\83g\82ð\83f\83X\83g\83\89\83N\83^\82Å\8e©\93®\94j\8aü\82³\82ê\82é\82æ\82¤\82É\82µ\82½\82à\82Ì
10         ///
11         class COpenJtalkCore:public ISpeaker{
12
13         private:
14                 OpenJTalk openJtalk_internal;           //\93à\95\94\83I\83u\83W\83F\83N\83g
15                 bool manageFlag;                                        //\8aÇ\97\9d\83t\83\89\83O
16                 CComAutoCriticalSection synthesisQueueCS;
17                 std::queue<CString> synthesisQueue;
18                 HANDLE synthesisThreadHandle;           //\93Ç\82Ý\8fã\82°\83X\83\8c\83b\83h\83n\83\93\83h\83\8b
19                 HANDLE synthesisEventObject;
20                 HANDLE endEventObject;
21         protected:
22                 ///
23                 ///\83R\83\93\83X\83g\83\89\83N\83^
24                 ///
25                 COpenJtalkCore();
26
27                 ///
28                 ///\83f\83X\83g\83\89\83N\83^
29                 ///
30                 virtual ~COpenJtalkCore();
31
32         
33
34         protected:
35                 ///
36                 ///\8f\89\8aú\89»\8aÖ\90\94
37                 ///
38                 void Initialize( HTS_Boolean use_lpf, int sampling_rate,
39                           int fperiod, double alpha, int stage, double beta, int audio_buff_size,
40                           double uv_threshold, HTS_Boolean use_log_gain, double gv_weight_mgc,
41                           double gv_weight_lf0, double gv_weight_lpf);
42
43
44                 ///
45                 ///\89¹\90º\83t\83@\83C\83\8b\93Ç\82Ý\8d\9e\82Ý
46                 ///
47                 void Load( const TChar_P in_voiceDataDir,const TChar_P in_dictinalyDataDir, Char_P fn_ms_dur, Char_P fn_ts_dur,
48                     Char_P fn_ms_mgc, Char_P fn_ts_mgc, Char_P *fn_ws_mgc, int num_ws_mgc,
49                     Char_P fn_ms_lf0, Char_P fn_ts_lf0, Char_P *fn_ws_lf0, int num_ws_lf0,
50                     Char_P fn_ms_lpf, Char_P fn_ts_lpf, Char_P *fn_ws_lpf, int num_ws_lpf,
51                     Char_P fn_ms_gvm, Char_P fn_ts_gvm, Char_P fn_ms_gvl, Char_P fn_ts_gvl,
52                     Char_P fn_ms_gvf, Char_P fn_ts_gvf, Char_P fn_gv_switch);
53                 
54         public:
55
56                 ///
57                 ///\89¹\90º\8d\87\90¬
58                 ///
59                 void Synthesis( const TChar_P txt, FILE * wavfp, FILE * logfp);
60
61
62                 ///
63                 ///\89¹\90º\8d\87\90¬\83C\83\93\83^\81[\83t\83F\81[\83X\8eÀ\91\95
64                 ///
65                 void Synthesis(const TChar_P txt);
66
67
68                 ///
69                 ///\94ñ\93¯\8aú\93Ç\82Ý\8fã\82°\83C\83\93\83^\81[\83t\83F\81[\83X\8eÀ\91\95
70                 ///
71                 void SynthesisAsync(const TChar_P txt);
72
73                 ///
74                 ///\83I\83u\83W\83F\83N\83g\82Ì\83N\83\8a\83A
75                 ///
76                 void Clear();
77
78
79         private:
80                 ///
81                 ///\94ñ\93¯\8aú\93Ç\82Ý\8fã\82°\97p\82Ì\83X\83\8c\83b\83h\8aÖ\90\94
82                 ///
83                 static unsigned WINAPI SynthesisThreadFunction(void *userData);
84         };
85         
86
87 }
88 }