Skip to content

Commit

Permalink
Refactor the method to produce spectrograms
Browse files Browse the repository at this point in the history
#isse #278 Refactoring.
  • Loading branch information
towsey committed Dec 8, 2019
1 parent b93a667 commit d39e982
Show file tree
Hide file tree
Showing 3 changed files with 184 additions and 168 deletions.
13 changes: 6 additions & 7 deletions src/AnalysisPrograms/Audio2InputForConvCNN.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// --------------------------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Audio2InputForConvCNN.cs" company="QutEcoacoustics">
// All code in this file and all associated files are the copyright and property of the QUT Ecoacoustics Research Group (formerly MQUTeR, and formerly QUT Bioacoustics Research Group).
// </copyright>
Expand Down Expand Up @@ -810,14 +810,13 @@ public AnalysisResult2 Analyze<T>(AnalysisSettings analysisSettings, SegmentSett
var configurationDictionary = new Dictionary<string, string>(configuration.ToDictionary());
configurationDictionary[ConfigKeys.Recording.Key_RecordingCallName] = audioFile.FullName;
configurationDictionary[ConfigKeys.Recording.Key_RecordingFileName] = audioFile.Name;
var soxImage = new FileInfo(Path.Combine(segmentSettings.SegmentOutputDirectory.FullName, audioFile.Name + ".SOX.png"));
//var soxImage = new FileInfo(Path.Combine(segmentSettings.SegmentOutputDirectory.FullName, audioFile.Name + ".SOX.png"));

var spectrogramResult = Audio2Sonogram.GenerateFourSpectrogramImages(
var spectrogramResult = Audio2Sonogram.GenerateSpectrogramImages(
audioFile,
soxImage,
configurationDictionary,
dataOnly: analysisSettings.AnalysisImageSaveBehavior.ShouldSave(),
makeSoxSonogram: false);
//soxImage,
configurationDictionary);
//dataOnly: analysisSettings.AnalysisImageSaveBehavior.ShouldSave());

// this analysis produces no results!
// but we still print images (that is the point)
Expand Down
Loading

0 comments on commit d39e982

Please sign in to comment.