2011年5月9日 星期一

hts_engine_1.04 use default pitch

In hts_engine, which used parameter generater algorithm and gv to generate spectral and excitation. The excitation generated is not the original pitch.

You can change the program in HTS_gstream.c->void HTS_GStreamSet_create() :

original :
gss->gstream[i].par[j][k] = HTS_PStreamSet_get_parameter(pss, i, msd_frame, k);

after :
gss->gstream[i].par[j][k] = pss->pstream[1].sm.mean[gss_index][0];

2011年5月7日 星期六

Visual Stdio Debug Using argc, argv

add command below :

hts_engine_1.04 error solve

error:

1>HTS_audio.obj : error LNK2019: 無法解析的外部符號 __imp__waveOutPrepareHeader@12 在函式 _HTS_Audio_open 中被參考
1>HTS_audio.obj : error LNK2019: 無法解析的外部符號 __imp__waveOutOpen@24 在函式 _HTS_Audio_open 中被參考
1>HTS_audio.obj : error LNK2019: 無法解析的外部符號 __imp__waveOutWrite@12 在函式 _HTS_Audio_write_buffer 中被參考
1>HTS_audio.obj : error LNK2019: 無法解析的外部符號 __imp__waveOutClose@4 在函式 _HTS_Audio_close 中被參考
1>HTS_audio.obj : error LNK2019: 無法解析的外部符號 __imp__waveOutUnprepareHeader@12 在函式 _HTS_Audio_close 中被參考
1>HTS_audio.obj : error LNK2019: 無法解析的外部符號 __imp__waveOutReset@4 在函式 _HTS_Audio_close 中被參考
1>D:\cproject\hts_engine_1.04\Debug\hts_engine_1.04.exe : fatal error LNK1120: 6 個無法解析的外部符號


solve, add follow instruction:

#pragma comment(lib, "winmm.lib")

2011年4月30日 星期六

Fibonacci number

---------Java not recursice------------------------------

int maxnumber = 1000;
Vector< Integer > F_array = new Vector< Integer >();

F_array.SetElementAt( 0, 0);
F_array.SetElementAt( 1, 1);

for ( int i = 2 ; i < maxnumber ; i++ ) {

F_array.SetElementAt( i, F_array.ElementAt(i-1) + F_array.ElementAt(i-2) );

} // for

---------Java recursice------------------------------------

int FibonacciNumber( int index ) {

if ( index > 1 ) {
return FibonacciNumber( index-1 ) + FibonacciNumber( index-2 ) ;
} // if
else if ( index == 1 ) {
return 1;
} // else if
else {
return 0;
} // else


}