Esempio n. 1
0
        public void GenerateSpectrogram(SpeechData _sample)
        {
            string clipPath = Path.Combine(clipsPath, _sample.path);
            string imgPath  = _sample.ImagePath;

            SpectrogramBuilder spectrogramBuilder = new SpectrogramBuilder();

            spectrogramBuilder.ImagePath     = imgPath;
            spectrogramBuilder.ImageColormap = Colormap.Viridis;
            spectrogramBuilder.BuildSpectrogram(clipPath);
        }
Esempio n. 2
0
        public static void GenerateSpectrogram(string _samplePath)
        {
            string clipPath     = Path.Combine(clipsPath, _samplePath);
            string baseFileName = Path.GetFileNameWithoutExtension(_samplePath);
            string imgPath      = Path.Combine(spectrogramsPath, baseFileName + ".jpg");

            SpectrogramBuilder spectrogramBuilder = new SpectrogramBuilder();

            spectrogramBuilder.ImagePath     = imgPath;
            spectrogramBuilder.ImageColormap = Colormap.Greens;
            spectrogramBuilder.BuildSpectrogram(clipPath);
        }
Esempio n. 3
0
        public static void RecordAudioFromMicro(
            string audioFileName = "vlog.wav",
            string imageFilePath = "images\\viridis.jpg")
        {
            string   path     = audioFileName;
            Recorder recorder = new Recorder(null, path);

            Console.WriteLine("Start recording...");
            recorder.FinishRecord = () =>
            {
                Console.ReadKey();
            };
            recorder.RecordAudioToFile();
            while (recorder.IsRecordContinue)
            {
            }
            Console.WriteLine("Finish recording...");
            SpectrogramBuilder spectrogramBuilder = new SpectrogramBuilder();

            spectrogramBuilder.ImagePath     = imageFilePath;
            spectrogramBuilder.ImageColormap = Colormap.GrayscaleReversed;
            spectrogramBuilder.BuildSpectrogram(path);
            Console.WriteLine($"Record save to: \"{audioFileName}\"");
        }