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 |
|---|---|
| Analysis |
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 |
|---|---|---|
| Analysis |
analysisSettings | The analysis Settings. |
| Segment |
segmentSettings | The settings unique to the current segment being analyzed. |
Returns
| Type | Description |
|---|---|
| Analysis |
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 |
|---|---|---|
| Analysis |
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<Event |
events | The events to process. |
| Time |
unitTime | The unit time of the summary indices to produce. |
| Time |
duration | The duration of audio for the period analyzed that produced |
| Double | scoreThreshold | A threshold to filter out low-scoring events. |
Returns
| Type | Description |
|---|---|
| Summary |
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 |
|---|---|---|
| File |
file | The file that represents the config to read. |
Returns
| Type | Description |
|---|---|
| Analyzer |
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 |
|---|---|---|
| Analysis |
settings | The settings used for the analysis. |
| File |
inputFileSegment | A reference to the original audio file that was analyzed. |
| Event |
events | The events produced so far. |
| Summary |
indices | The summary indices produced so far. |
| Spectral |
spectralIndices | The spectra produced so far. |
| Analysis |
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 |
|---|---|---|
| File |
destination | The file to write to. |
| IEnumerable<Event |
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 |
|---|---|---|
| Directory |
destination | The file to write to. |
| String | fileNameBase | |
| IEnumerable<Spectral |
results | The results to write. |
Returns
| Improve this Doc View SourceWriteSummaryIndicesFile(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 |
|---|---|---|
| File |
destination | The file to write to. |
| IEnumerable<Summary |
results | The results to write. |