Skip to content

Commit

Permalink
Update libraries to fix 401
Browse files Browse the repository at this point in the history
  • Loading branch information
GewoonJaap committed Oct 16, 2023
1 parent 17feab7 commit 675044f
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 29 deletions.
2 changes: 1 addition & 1 deletion AudioExtractor/AudioExtractor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NAudio" Version="2.1.0" />
<PackageReference Include="NAudio" Version="2.2.1" />
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 4 additions & 1 deletion ConsoleApp/ConsoleApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@
<AssemblyName>WinWhisper</AssemblyName>
<ApplicationIcon>WhisperIcon.ico</ApplicationIcon>
<Platforms>AnyCPU;ARM64</Platforms>
<Version>1.1</Version>
<Description>WinWhisper is a Windows application that uses AI to detect and remove background noise from audio files.</Description>
<Authors>Jaap</Authors>
</PropertyGroup>

<ItemGroup>
<Content Include="WhisperIcon.ico" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Sentry" Version="3.28.1" />
<PackageReference Include="Sentry" Version="3.40.1" />
</ItemGroup>

<ItemGroup>
Expand Down
74 changes: 49 additions & 25 deletions ConsoleApp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,40 +14,64 @@
}))
{

try {

//create folder Subtitles if not exists
FolderManager.CreateFolder(FolderManager.SubtitlesFolder);
FolderManager.CreateFolder(FolderManager.WavFolder);
FolderManager.CreateFolder(FolderManager.Models);

while (true)
{
Console.Clear();
Console.WriteLine("Welcome to WinWhisper. Generate subtitles with ease using WhisperAI.");
Console.WriteLine("Enter the video path...");
var videoPath = Console.ReadLine() ?? string.Empty;
//if path starts and ends with ", remove
videoPath = VideoPathFormatter.formatVideoPath(videoPath);

Console.WriteLine("In which language code (en,nl etc) is the audio? Leave empty to auto detect");
var languageCode = Console.ReadLine() ?? string.Empty;
if (languageCode.Length > 2)
while (true)
{
languageCode = string.Empty;
}
Console.Clear();
Console.WriteLine("Welcome to WinWhisper. Generate subtitles with ease using WhisperAI.");
Console.WriteLine("Enter the video path...");
var videoPath = Console.ReadLine() ?? string.Empty;
//if path starts and ends with ", remove
videoPath = VideoPathFormatter.formatVideoPath(videoPath);

var audioPath = Extractor.ExtractAudioFromVideoFile(videoPath);
Console.WriteLine("In which language code (en,nl etc) is the audio? Leave empty to auto detect");
var languageCode = Console.ReadLine() ?? string.Empty;
if (languageCode.Length > 2)
{
languageCode = string.Empty;
}

var audioProcessor = new AudioProcessor();
await audioProcessor.ProcessAudio(audioPath, languageCode);
//remove audioPath file
File.Delete(audioPath);
Console.WriteLine("Finished audio processing");
var audioPath = Extractor.ExtractAudioFromVideoFile(videoPath);

Console.WriteLine("Do you want to process another video? (yes/no)");
var processAnotherVideo = Console.ReadLine() ?? string.Empty;
if (processAnotherVideo.ToLower() == "no" || processAnotherVideo.ToLower() == "n")
{
break;
var audioProcessor = new AudioProcessor();
await audioProcessor.ProcessAudio(audioPath, languageCode);
//remove audioPath file
File.Delete(audioPath);
Console.WriteLine("Finished audio processing");

Console.WriteLine("Do you want to process another video? (yes/no)");
var processAnotherVideo = Console.ReadLine() ?? string.Empty;
if (processAnotherVideo.ToLower() == "no" || processAnotherVideo.ToLower() == "n")
{
break;
}
}

}
catch(Exception ex)
{
SentrySdk.CaptureException(ex);
Console.WriteLine("An error occured. Please report the following on our GitHub page: https://github.com/GewoonJaap/WinWhisper/issues/new?assignees=&labels=&projects=&template=bug_report.md&title=");
Console.WriteLine("Error details:");
Console.WriteLine("========== Start Of Error ==========");
Console.WriteLine("Error name:");
Console.WriteLine(ex.GetType()?.Name);
Console.WriteLine("Error message:");
Console.WriteLine(ex.Message);
Console.WriteLine("Error stacktrace:");
Console.WriteLine(ex.StackTrace);
Console.WriteLine("Error inner exception:");
Console.WriteLine(ex.InnerException?.Message);
Console.WriteLine("Error inner exception stacktrace:");
Console.WriteLine(ex.InnerException?.StackTrace);
Console.WriteLine("========== End Of Error ==========");
Console.WriteLine("Press any key to exit...");
Console.ReadKey();
}
}
3 changes: 2 additions & 1 deletion Utility/Utility.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Whisper.net" Version="1.2.1" />
<PackageReference Include="Whisper.net" Version="1.4.7" />
<PackageReference Include="Whisper.net.Runtime" Version="1.4.7" />
</ItemGroup>

</Project>
3 changes: 2 additions & 1 deletion WhisperAI/WhisperAI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Whisper.net" Version="1.2.1" />
<PackageReference Include="Whisper.net" Version="1.4.7" />
<PackageReference Include="Whisper.net.Runtime" Version="1.4.7" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 675044f

Please sign in to comment.