diff options
| author | Konstantin <const@const.me> | 2023-01-19 17:10:24 +0100 |
|---|---|---|
| committer | Konstantin <const@const.me> | 2023-01-19 17:10:24 +0100 |
| commit | 9df2ee2ead4ce23d06351a6cdb4fea588f79e429 (patch) | |
| tree | d365bc24b192e3929801a4ede5b26e74a6c9e77f /Examples/WhisperDesktop | |
| parent | 06643094c166b0e80fb8f5f506f5e9d42a90c2bf (diff) | |
Workaround for the Microsoft’s bug in their MP3 decoder MFT
Diffstat (limited to 'Examples/WhisperDesktop')
| -rw-r--r-- | Examples/WhisperDesktop/TranscribeDlg.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Examples/WhisperDesktop/TranscribeDlg.cpp b/Examples/WhisperDesktop/TranscribeDlg.cpp index cd23c93..b99e98a 100644 --- a/Examples/WhisperDesktop/TranscribeDlg.cpp +++ b/Examples/WhisperDesktop/TranscribeDlg.cpp @@ -298,7 +298,6 @@ HRESULT TranscribeDlg::transcribe() CComPtr<iAudioReader> reader; CHECK_EX( appState.mediaFoundation->openAudioFile( transcribeArgs.pathMedia, false, &reader ) ); - CHECK_EX( reader->getDuration( transcribeArgs.mediaDuration ) ); const eOutputFormat format = transcribeArgs.format; CAtlFile outputFile; @@ -324,6 +323,11 @@ HRESULT TranscribeDlg::transcribe() // Run the transcribe CHECK_EX( context->runStreamed( fullParams, progressSink, reader ) ); + // Once finished, query duration of the audio. + // The duration before the processing is sometimes different, by 20 seconds for the file in that issue: + // https://github.com/Const-me/Whisper/issues/4 + CHECK_EX( reader->getDuration( transcribeArgs.mediaDuration ) ); + context->timingsPrint(); if( format == eOutputFormat::None ) |
