The primary AudioWorks API. AudioWorks is a cross-platform, multi-format audio conversion and tagging suite.
$ dotnet add package AudioWorks.ApiThis is the public API for AudioWorks, a cross-platform, multi-format audio conversion and tagging suite.
You should also consume one or more "Extensions" packages (see Related Packages below) for full functionality.
More documentation is available on the GitHub repository.
var flacFiles = new DirectoryInfo("<path to an album>")
.GetFiles("*.flac")
.Select(file => new TaggedAudioFile(file.FullName));
// Export the files to Opus format, organized into directories and named according to metadata
var opusEncoder = new AudioFileEncoder("Opus")
{
EncodedDirectoryName = @"C:\Output\{Album} by {Artist}",
EncodedFileName = "{TrackNumber} - {Title}",
Overwrite = true,
Settings = new()
{
["SignalType"] = "Speech",
["BitRate"] = 32
}
};
await opusEncoder.EncodeAsync(flacFiles);
var flacFiles = new DirectoryInfo("<path to an album>")
.GetFiles("*.flac")
.Select(file => new TaggedAudioFile(file.FullName));
// Add ReplayGain tags, analyzing the files as a single album
var replayGainAnalyzer = new AudioFileAnalyzer("ReplayGain");
await replayGainAnalyzer.AnalyzeAsync(flacFiles);
// Set the artist as well, then persist the new tags to disk
foreach (var flacFile in flacFiles)
{
flacFile.Metadata.Artist = "Iron Butterfly";
flacFile.SaveMetadata();
}
The main types provided by this library are:
TaggedAudioFileAudioFileEncoderAudioFileAnalyzerCoverArtExtractorAudioWorks is released as open source under the GNU Affero General Public License. Bug reports and contributions are welcome at the GitHub repository.