Skip to content

Commit

Permalink
Add additional console output indicates transcribe progress.
Browse files Browse the repository at this point in the history
  • Loading branch information
azhuge233 committed Nov 28, 2023
1 parent 5a7616b commit 801d92e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[*.cs]

# CA1862: 使用 "StringComparison" 方法重载来执行不区分大小写的字符串比较
dotnet_diagnostic.CA1862.severity = silent
7 changes: 6 additions & 1 deletion ConsoleWhisper.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.6.33801.468
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleWhisper", "ConsoleWhisper\ConsoleWhisper.csproj", "{5C6A46FF-A067-4C5E-926E-43607BD8B04C}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsoleWhisper", "ConsoleWhisper\ConsoleWhisper.csproj", "{5C6A46FF-A067-4C5E-926E-43607BD8B04C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9C78D1D0-212B-4261-98A0-9744465E013D}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
4 changes: 4 additions & 0 deletions ConsoleWhisper/ConsoleWhisper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
<Version>1.1.0</Version>
<Authors>azhuge233</Authors>
</PropertyGroup>

<ItemGroup>
<None Include="..\.editorconfig" Link=".editorconfig" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.9.1" />
Expand Down
3 changes: 3 additions & 0 deletions ConsoleWhisper/Module/WhisperHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ internal class WhisperHelper {
using var waveFileStream = File.OpenRead(wavFilename);
using var transcriptFileStream = File.OpenWrite(FileHelper.GetTranscriptPath(outputDir, mediaFilename));

Output.Info("Start transcription...");

int cnt = 1;
await foreach(var result in processor.ProcessAsync(waveFileStream)) {
await FileHelper.AddText(transcriptFileStream, cnt++);
Expand All @@ -30,6 +32,7 @@ internal class WhisperHelper {
await FileHelper.AddText(transcriptFileStream, "\n\n");
}

Output.Info("Done.");
} catch (Exception) {
throw;
}
Expand Down

0 comments on commit 801d92e

Please sign in to comment.