Interface IAnalyser2
Interface a compatible analysis must implement.
This is a strong typed version of IAnalyser
intentionally removed from the old inheritance tree.
DO NOT MODIFY THIS FILE UNLESS INSTRUCTED TO!.
Namespace: AnalysisBase
Assembly: AnalysisBase.dll
Syntax
public interface IAnalyser2 : ICiteable, IHasStatus
Properties
| Improve this Doc View SourceDefaultSettings
Gets the initial (default) settings for the analysis.
Declaration
AnalysisSettings DefaultSettings { get; }
Property Value
Type | Description |
---|---|
AnalysisSettings |
Description
Gets a user friendly string describing the analyzer. Intending for printing in the console.
Declaration
string Description { get; }
Property Value
Type | Description |
---|---|
String |
DisplayName
Gets the name to display for the analysis.
Declaration
string DisplayName { get; }
Property Value
Type | Description |
---|---|
String |
Identifier
Gets Identifier. This should be a dotted uniquely identifying name. E.g.
Towsey.MultiAnalyser
.
Declaration
string Identifier { get; }
Property Value
Type | Description |
---|---|
String |
Methods
| Improve this Doc View SourceAnalyze<T>(AnalysisSettings, SegmentSettings<T>)
Run analysis using the given analysis settings.
Declaration
AnalysisResult2 Analyze<T>(AnalysisSettings analysisSettings, SegmentSettings<T> segmentSettings)
Parameters
Type | Name | Description |
---|---|---|
AnalysisSettings | analysisSettings | The analysis Settings. |
SegmentSettings<T> | segmentSettings | The settings unique to the current segment being analyzed. |
Returns
Type | Description |
---|---|
AnalysisResult2 | The results of the analysis. |
Type Parameters
Name | Description |
---|---|
T |
BeforeAnalyze(AnalysisSettings)
A hook to modify analysis settings before an analysis is run. Ideally run once (whereas Analyze is run N times).
Declaration
void BeforeAnalyze(AnalysisSettings analysisSettings)
Parameters
Type | Name | Description |
---|---|---|
AnalysisSettings | analysisSettings | The analysis Settings. |
ConvertEventsToSummaryIndices(IEnumerable<EventBase>, TimeSpan, TimeSpan, Double)
Allows Events to be rendered as Summary Indices.
Declaration
SummaryIndexBase[] ConvertEventsToSummaryIndices(IEnumerable<EventBase> events, TimeSpan unitTime, TimeSpan duration, double scoreThreshold)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<EventBase> | events | The events to process. |
TimeSpan | unitTime | The unit time of the summary indices to produce. |
TimeSpan | duration | The duration of audio for the period analyzed that produced |
Double | scoreThreshold | A threshold to filter out low-scoring events. |
Returns
Type | Description |
---|---|
SummaryIndexBase[] | A set of summary indices that describe the input events. |
Remarks
This method used to be used on every segment but we are phasing out
segment-level results. Thus it is recommended it only be used at the end of the analysis
when the full result set (and when duration
equals the full recording length)
is available.
ParseConfig(FileInfo)
An (optional) method for returning a strongly typed config file.
Declaration
AnalyzerConfig ParseConfig(FileInfo file)
Parameters
Type | Name | Description |
---|---|---|
FileInfo | file | The file that represents the config to read. |
Returns
Type | Description |
---|---|
AnalyzerConfig | Ideally a strongly typed config, but as a fallback, a base Config can be returned. |
SummariseResults(AnalysisSettings, FileSegment, EventBase[], SummaryIndexBase[], SpectralIndexBase[], AnalysisResult2[])
Post-processing for an entire analysis.
Declaration
void SummariseResults(AnalysisSettings settings, FileSegment inputFileSegment, EventBase[] events, SummaryIndexBase[] indices, SpectralIndexBase[] spectralIndices, AnalysisResult2[] results)
Parameters
Type | Name | Description |
---|---|---|
AnalysisSettings | settings | The settings used for the analysis. |
FileSegment | inputFileSegment | A reference to the original audio file that was analyzed. |
EventBase[] | events | The events produced so far. |
SummaryIndexBase[] | indices | The summary indices produced so far. |
SpectralIndexBase[] | spectralIndices | The spectra produced so far. |
AnalysisResult2[] | results | The raw result objects produced so far. |
WriteEventsFile(FileInfo, IEnumerable<EventBase>)
Ensures abstract types are downcast by the analyzer and written to file.
Declaration
void WriteEventsFile(FileInfo destination, IEnumerable<EventBase> results)
Parameters
Type | Name | Description |
---|---|---|
FileInfo | destination | The file to write to. |
IEnumerable<EventBase> | results | The results to write. |
WriteSpectrumIndicesFiles(DirectoryInfo, String, IEnumerable<SpectralIndexBase>)
Ensures abstract types are downcast by the analyzer and written to file.
Declaration
List<FileInfo> WriteSpectrumIndicesFiles(DirectoryInfo destination, string fileNameBase, IEnumerable<SpectralIndexBase> results)
Parameters
Type | Name | Description |
---|---|---|
DirectoryInfo | destination | The file to write to. |
String | fileNameBase | |
IEnumerable<SpectralIndexBase> | results | The results to write. |
Returns
Type | Description |
---|---|
List<FileInfo> |
WriteSummaryIndicesFile(FileInfo, IEnumerable<SummaryIndexBase>)
Ensures abstract types are downcast by the analyzer and written to file.
Declaration
void WriteSummaryIndicesFile(FileInfo destination, IEnumerable<SummaryIndexBase> results)
Parameters
Type | Name | Description |
---|---|---|
FileInfo | destination | The file to write to. |
IEnumerable<SummaryIndexBase> | results | The results to write. |