-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1.Used ffmpeg to detect empty audios and duplicated audios.
2.Cleanup and refactoring.
- Loading branch information
Showing
14 changed files
with
273 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Text.RegularExpressions; | ||
using System.Threading.Tasks; | ||
using OKEGui.Utils; | ||
|
||
namespace OKEGui | ||
{ | ||
class FFmpegVolumeChecker : CommandlineJobProcessor | ||
{ | ||
public double MeanVolume { get; private set; } | ||
public double MaxVolume { get; private set; } | ||
|
||
public FFmpegVolumeChecker(string inputFile) | ||
{ | ||
executable = Constants.ffmpegPath; | ||
commandLine = "-i \"" + inputFile + "\" -af volumedetect -f null /dev/null"; | ||
} | ||
|
||
public override void ProcessLine(string line, StreamType stream) | ||
{ | ||
if (line.Contains("mean_volume")) | ||
{ | ||
Regex rf = new Regex("mean_volume: (-[0-9]+.[0-9]+) dB"); | ||
string[] result = rf.Split(line); | ||
MeanVolume = double.Parse(result[1]); | ||
} | ||
if (line.Contains("max_volume")) | ||
{ | ||
Regex rf = new Regex("max_volume: (-[0-9]+.[0-9]+) dB"); | ||
string[] result = rf.Split(line); | ||
MaxVolume = double.Parse(result[1]); | ||
SetFinish(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.