Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1388,7 +1388,7 @@ private void PerformSyncOperation<TOperation>(ref OperationQueue<TOperation> que
bool timeoutExpired = false;
while (true)
{
DateTime waitStart = DateTime.UtcNow;
long waitStart = Stopwatch.GetTimestamp();

if (!e.Wait(timeout))
{
Expand All @@ -1411,7 +1411,7 @@ private void PerformSyncOperation<TOperation>(ref OperationQueue<TOperation> que
// Adjust timeout and try again.
if (timeout > 0)
{
timeout -= (DateTime.UtcNow - waitStart).Milliseconds;
timeout -= (int)Stopwatch.GetElapsedTime(waitStart).TotalMilliseconds;

if (timeout <= 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -480,17 +480,17 @@ private void ConvertCompleteUnit()
// Retain any other information based on the first TTS phoneme event.
//
TTSEvent ttsEvent, targetEvent, basePhonemeEvent = null;
long totalDuration = 0;
long totalDurationTicks = 0;
basePhonemeEvent = (TTSEvent)_phonemeQueue.Peek();
for (int i = 0; i < _lastComplete;)
{
ttsEvent = (TTSEvent)_phonemeQueue.Dequeue();
totalDuration += ttsEvent.PhonemeDuration.Milliseconds;
totalDurationTicks += ttsEvent.PhonemeDuration.Ticks;
i += ttsEvent.Phoneme.Length;
}

targetEvent = TTSEvent.CreatePhonemeEvent(new string(target), "",
TimeSpan.FromMilliseconds(totalDuration),
TimeSpan.FromTicks(totalDurationTicks),
basePhonemeEvent.PhonemeEmphasis,
basePhonemeEvent.Prompt,
basePhonemeEvent.AudioPosition);
Expand Down
Loading