fix: fix error messages and remove unnecessary null check and use input file name for audio output name
This commit is contained in:
@@ -92,12 +92,6 @@ internal sealed class DefaultCommand(
|
||||
.Spinner(Spinner.Known.Dots)
|
||||
.StartAsync("Extracting audio...", async _ => await _audioExtractor.ExtractMp3FromMp4Async(videoStream, audioStream));
|
||||
|
||||
if (audioStream is null)
|
||||
{
|
||||
_console.MarkupLine("[red]Failed[/] to extract audio from the stream.");
|
||||
return (int)ExitCode.FailedToExtractAudio;
|
||||
}
|
||||
|
||||
_console.MarkupLine($"[blue]Audio extracted[/] [green]successfully![/]");
|
||||
|
||||
List<TranscriptionSegment> transcriptionSegments = [];
|
||||
@@ -199,7 +193,6 @@ internal sealed class DefaultCommand(
|
||||
|
||||
private enum ExitCode
|
||||
{
|
||||
FailedToExtractAudio,
|
||||
FailedToAnalyzeTranscript,
|
||||
SuccessFullyProcessedStream,
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public sealed class AudioExtractor : IAudioExtractor
|
||||
|
||||
if (IsVideoStreamUsable(video) is false)
|
||||
{
|
||||
throw new ArgumentException("Stream must be non-null, readable, and seekable", nameof(video));
|
||||
throw new ArgumentException("Stream must be readable and seekable", nameof(video));
|
||||
}
|
||||
|
||||
if (audio is null)
|
||||
@@ -44,7 +44,7 @@ public sealed class AudioExtractor : IAudioExtractor
|
||||
|
||||
if (IsAudioStreamUsable(audio) is false)
|
||||
{
|
||||
throw new ArgumentException("Stream must be non-null, writable, and seekable", nameof(audio));
|
||||
throw new ArgumentException("Stream must be writable and seekable", nameof(audio));
|
||||
}
|
||||
|
||||
var originalPosition = video.Position;
|
||||
|
||||
Reference in New Issue
Block a user