galat****@lists*****
galat****@lists*****
2006年 11月 14日 (火) 10:01:43 JST
Index: gtalk/modify_parameter.c diff -u gtalk/modify_parameter.c:1.18 gtalk/modify_parameter.c:1.19 --- gtalk/modify_parameter.c:1.18 Thu Oct 19 12:27:08 2006 +++ gtalk/modify_parameter.c Tue Nov 14 10:01:43 2006 @@ -6,7 +6,7 @@ /* Keiichi Tokuda, Takayoshi Yoshimura, Heiga Zen */ /* (Nagoya Institute of Technology) */ /* All rights reserved */ -/* $Id: modify_parameter.c,v 1.18 2006/10/19 03:27:08 sako Exp $ */ +/* $Id: modify_parameter.c,v 1.19 2006/11/14 01:01:43 sako Exp $ */ #include <stdio.h> #include <stdlib.h> @@ -184,7 +184,7 @@ void mod_f0_morph( MORPH* m1, MORPH* m2, int attrID, double rate ) { double time1, time2, lograte; - int i, i1, i2; + int i, i1, i2, shift_sil; MORA *mora1, *mora2; if( m1->mrhead == NULL ) { /* 「」など。*/ @@ -200,8 +200,9 @@ time1 = mora1->phead->ctime; time2 = mora2->ptail->ctime + mora2->ptail->time; - i1 = (int)( time1 / (double)(FRAME_RATE) ); - i2 = (int)( time2 / (double)(FRAME_RATE) ); + shift_sil = mhead->totalduration - (SILENCE_LENGTH/FRAME_RATE); + i1 = (int)( time1 / (double)(FRAME_RATE) ) + shift_sil; + i2 = (int)( time2 / (double)(FRAME_RATE) ) + shift_sil; switch( attrID ) { case TA_LEVEL: @@ -260,9 +261,9 @@ void mod_power_morph( MORPH* m1, MORPH* m2, int attrID, double rate ) { double time1, time2, lograte; - int i, i1, i2; + int i, i1, i2, shift_sil; MORA *mora1, *mora2; - + if( m1->mrhead == NULL ) { /* 「」など。*/ mora1 = m1->next->mrhead; } else { @@ -276,8 +277,9 @@ time1 = mora1->phead->ctime; time2 = mora2->ptail->ctime + mora2->ptail->time; - i1 = (int)( time1 / (double)(FRAME_RATE) ); - i2 = (int)( time2 / (double)(FRAME_RATE) ); + shift_sil = mhead->totalduration - (SILENCE_LENGTH/FRAME_RATE); + i1 = (int)( time1 / (double)(FRAME_RATE) ) + shift_sil; + i2 = (int)( time2 / (double)(FRAME_RATE) ) + shift_sil; if( rate < 0.01 ) rate = 0.01;