cs-mel-spectrogram 1.0.1

Audio to Mel-Spectrogram Image for x64 Build

Install-Package cs-mel-spectrogram -Version 1.0.1
dotnet add package cs-mel-spectrogram --version 1.0.1
<PackageReference Include="cs-mel-spectrogram" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add cs-mel-spectrogram --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

cs-mel-spectrogram

Convert audio file to melgram (that is, me-spectrogram) in .NET

Install

Run the following nuget command to install:

Install-Package cs-mel-spectrogram

Usage

The sample code below shows how to use the MelGram to convert an (any) audio file to a mel-spectrogram image:

using System;
using System.Drawing;
using System.IO;

namespace MelGram
{
    class Program
    {
        static void Main(string[] args)
        {
            MelSpectrogram gram = new MelSpectrogram();
            string dataDirPath = Path.Combine(IOUtils.AssemblyDirectory, "..", "..", "..", "..", "gtzan", "genres");
            if (!Directory.Exists(dataDirPath))
            {
                Console.WriteLine("{0} does not exists", dataDirPath);
                return;
            }

            string[] subDirectories = Directory.GetDirectories(dataDirPath);
            foreach (string subDirectory in subDirectories)
            {
                string[] files = Directory.GetFiles(subDirectory, "*.au");
                foreach (string file in files)
                {
                    Console.WriteLine("Converting: {0}", file);
                    Bitmap img = gram.Convert(file, 48);
                    img.Save(file + ".png");
                }

            }
        }
    }
}

cs-mel-spectrogram

Convert audio file to melgram (that is, me-spectrogram) in .NET

Install

Run the following nuget command to install:

Install-Package cs-mel-spectrogram

Usage

The sample code below shows how to use the MelGram to convert an (any) audio file to a mel-spectrogram image:

using System;
using System.Drawing;
using System.IO;

namespace MelGram
{
    class Program
    {
        static void Main(string[] args)
        {
            MelSpectrogram gram = new MelSpectrogram();
            string dataDirPath = Path.Combine(IOUtils.AssemblyDirectory, "..", "..", "..", "..", "gtzan", "genres");
            if (!Directory.Exists(dataDirPath))
            {
                Console.WriteLine("{0} does not exists", dataDirPath);
                return;
            }

            string[] subDirectories = Directory.GetDirectories(dataDirPath);
            foreach (string subDirectory in subDirectories)
            {
                string[] files = Directory.GetFiles(subDirectory, "*.au");
                foreach (string file in files)
                {
                    Console.WriteLine("Converting: {0}", file);
                    Bitmap img = gram.Convert(file, 48);
                    img.Save(file + ".png");
                }

            }
        }
    }
}

Release Notes

Audio to Mel-Spectrogram in .NET 4.6.1 and x64 Build

Dependencies

This package has no dependencies.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.1 440 4/29/2018