Ejemplo n.º 1
0
        public AudioFixture()
        {
            // sox command to test failed audio files
            // sox --i -V6 "FILE"

            FindSimilarAudioService = new FindSimilarAudioService();
            SampleRate    = 32000;
            DirectoryPath = @"C:\Users\pnerseth\My Projects\test-output";

            // create if it doesn't exist
            if (!Directory.Exists(DirectoryPath))
            {
                Directory.CreateDirectory(DirectoryPath);
            }

            Log.Logger = new LoggerConfiguration()
                         .MinimumLevel.Verbose()
                         .WriteTo.Console()
                         .CreateLogger();
        }
Ejemplo n.º 2
0
        public void Test1()
        {
            // https://github.com/AddictedCS/soundfingerprinting.soundtools/blob/master/src/SoundFingerprinting.SoundTools/DrawningTool/WinDrawningTool.cs

            string    pathToSourceFile = @"C:\Users\pnerseth\Amazon Drive\Documents\Audio\FL Projects\!PERIVAR\Clean Bandit - Rather Be Programming\Clean Bandit - Region 1 Slow.wav";
            const int sampleRate       = 32000;
            string    DirectoryPath    = @"C:\Users\pnerseth\My Projects\test-output";

            var          audioService = new FindSimilarAudioService();
            AudioSamples data         = audioService.ReadMonoSamplesFromFile(pathToSourceFile, sampleRate, 2, 5);

/*
 *          var imageService = new FindSimilarImageService();
 *          using (Image image = imageService.GetSignalImage(data.Samples, 2000, 500))
 *          {
 *              image.Save(Path.Combine(DirectoryPath, "_downsampled.png"), ImageFormat.Jpeg);
 *          }
 *
 */
            SoundIO.WriteWaveFile(Path.Combine(DirectoryPath, "_resampled.wav"), data.Samples, sampleRate);
        }