c# - Audio position in SpeakProgress event is not correct for "Microsoft Anna" voice -
c# - Audio position in SpeakProgress event is not correct for "Microsoft Anna" voice -
in text speech application c# utilize speechsynthesizer class, has event named speakprogress fired every spoken word. voices including "microsoft anna" parameter e.audioposition
not synchronized output sound stream, , sound stream played faster auidoposition indicates.
void reader_speakprogress(object sender, speakprogresseventargs e) { console.write(e.audioposition + ""); }
i thought maybe problem bitrate , wavestream output utilize following.
filestream audiostream = new filestream(fname, filemode.create, fileaccess.write); reader.setoutputtowavestream(audiostream);
i tried
var formats = curvoice.voiceinfo.supportedaudioformats; reader.setoutputtoaudiostream(audiostream, formats[0]);
but problem output file not played. have suggestions why voice not synch , why solution has no playable output audio?
as have guessed problem related bitrate, enforce sound format used alternative method named setoutputtowavefile
var formats = curvoice.voiceinfo.supportedaudioformats; reader.setoutputtowavefile(fname, formats[0]);
with code above, sound output playable , synching problem resolved!
c# text-to-speech
Comments
Post a Comment