-
Notifications
You must be signed in to change notification settings - Fork 314
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Audio Track Analysis models and API endpoint (#161)
* Add Audio Track Analysis models and API endpoint * Update docs * Add link to EchoNest archived docs for AudioAnalysis model
- Loading branch information
1 parent
de30c50
commit 17639a9
Showing
10 changed files
with
295 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace SpotifyAPI.Web.Models | ||
{ | ||
public class AnalysisMeta | ||
{ | ||
[JsonProperty("analyzer_platform")] | ||
public string AnalyzerVersion { get; set; } | ||
|
||
[JsonProperty("platform")] | ||
public string Platform { get; set; } | ||
|
||
[JsonProperty("status_code")] | ||
public int StatusCode { get; set; } | ||
|
||
[JsonProperty("detailed_status")] | ||
public string DetailedStatus { get; set; } | ||
|
||
[JsonProperty("timestamp")] | ||
public long Timestamp { get; set; } | ||
|
||
[JsonProperty("analysis_time")] | ||
public double AnalysisTime { get; set; } | ||
|
||
[JsonProperty("input_process")] | ||
public string InputProcess { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace SpotifyAPI.Web.Models | ||
{ | ||
public class AnalysisSection | ||
{ | ||
[JsonProperty("start")] | ||
public double Start { get; set; } | ||
|
||
[JsonProperty("duration")] | ||
public double Duration { get; set; } | ||
|
||
[JsonProperty("confidence")] | ||
public double Confidence { get; set; } | ||
|
||
[JsonProperty("loudness")] | ||
public double Loudness { get; set; } | ||
|
||
[JsonProperty("tempo")] | ||
public double Tempo { get; set; } | ||
|
||
[JsonProperty("tempo_confidence")] | ||
public double TempoConfidence { get; set; } | ||
|
||
[JsonProperty("key")] | ||
public int Key { get; set; } | ||
|
||
[JsonProperty("key_confidence")] | ||
public double KeyConfidence { get; set; } | ||
|
||
[JsonProperty("mode")] | ||
public int Mode { get; set; } | ||
|
||
[JsonProperty("mode_confidence")] | ||
public double ModeConfidence { get; set; } | ||
|
||
[JsonProperty("time_signature")] | ||
public int TimeSignature { get; set; } | ||
|
||
[JsonProperty("time_signature_confidence")] | ||
public double TimeSignatureConfidence { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using Newtonsoft.Json; | ||
using System.Collections.Generic; | ||
|
||
namespace SpotifyAPI.Web.Models | ||
{ | ||
public class AnalysisSegment | ||
{ | ||
[JsonProperty("start")] | ||
public double Start { get; set; } | ||
|
||
[JsonProperty("duration")] | ||
public double Duration { get; set; } | ||
|
||
[JsonProperty("confidence")] | ||
public double Confidence { get; set; } | ||
|
||
[JsonProperty("loudness_start")] | ||
public double LoudnessStart { get; set; } | ||
|
||
[JsonProperty("loudness_max_time")] | ||
public double LoudnessMaxTime { get; set; } | ||
|
||
[JsonProperty("loudness_max")] | ||
public double LoudnessMax { get; set; } | ||
|
||
[JsonProperty("loudness_end")] | ||
public double LoudnessEnd { get; set; } | ||
|
||
[JsonProperty("pitches")] | ||
public List<double> Pitches { get; set; } | ||
|
||
[JsonProperty("timbre")] | ||
public List<double> Timbre { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace SpotifyAPI.Web.Models | ||
{ | ||
public class AnalysisTimeSlice | ||
{ | ||
[JsonProperty("start")] | ||
public double Start { get; set; } | ||
|
||
[JsonProperty("duration")] | ||
public double Duration { get; set; } | ||
|
||
[JsonProperty("confidence")] | ||
public double Confidence { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace SpotifyAPI.Web.Models | ||
{ | ||
public class AnalysisTrack | ||
{ | ||
[JsonProperty("num_samples")] | ||
public int NumSamples { get; set; } | ||
|
||
[JsonProperty("duration")] | ||
public double Duration { get; set; } | ||
|
||
[JsonProperty("sample_md5")] | ||
public string SampleMD5 { get; set; } | ||
|
||
[JsonProperty("offset_seconds")] | ||
public double OffsetSeconds { get; set; } | ||
|
||
[JsonProperty("window_seconds")] | ||
public double WindowSeconds { get; set; } | ||
|
||
[JsonProperty("analysis_sample_rate")] | ||
public int AnalysisSampleRate { get; set; } | ||
|
||
[JsonProperty("analysis_channels")] | ||
public int AnalysisChannels { get; set; } | ||
|
||
[JsonProperty("end_of_fade_in")] | ||
public double EndOfFadeIn { get; set; } | ||
|
||
[JsonProperty("start_of_fade_out")] | ||
public double StartOfFadeOut { get; set; } | ||
|
||
[JsonProperty("loudness")] | ||
public double Loudness { get; set; } | ||
|
||
[JsonProperty("tempo")] | ||
public double Tempo { get; set; } | ||
|
||
[JsonProperty("tempo_confidence")] | ||
public double TempoConfidence { get; set; } | ||
|
||
[JsonProperty("time_signature")] | ||
public double TimeSignature { get; set; } | ||
|
||
[JsonProperty("time_signature_confidence")] | ||
public double TimeSignatureConfidence { get; set; } | ||
|
||
[JsonProperty("key")] | ||
public int Key { get; set; } | ||
|
||
[JsonProperty("key_confidence")] | ||
public double KeyConfidence { get; set; } | ||
|
||
[JsonProperty("mode")] | ||
public int Mode { get; set; } | ||
|
||
[JsonProperty("mode_confidence")] | ||
public double ModeConfidence { get; set; } | ||
|
||
[JsonProperty("codestring")] | ||
public string Codestring { get; set; } | ||
|
||
[JsonProperty("code_version")] | ||
public double CodeVersion { get; set; } | ||
|
||
[JsonProperty("echoprintstring")] | ||
public string Echoprintstring { get; set; } | ||
|
||
[JsonProperty("echoprint_version")] | ||
public double EchoprintVersion { get; set; } | ||
|
||
[JsonProperty("synchstring")] | ||
public string Synchstring { get; set; } | ||
|
||
[JsonProperty("synch_version")] | ||
public double SynchVersion { get; set; } | ||
|
||
[JsonProperty("rhythmstring")] | ||
public string Rhythmstring { get; set; } | ||
|
||
[JsonProperty("rhythm_version")] | ||
public double RhythmVersion { get; set; } | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using Newtonsoft.Json; | ||
using System.Collections.Generic; | ||
|
||
namespace SpotifyAPI.Web.Models | ||
{ | ||
public class AudioAnalysis : BasicModel | ||
{ | ||
[JsonProperty("bars")] | ||
public List<AnalysisTimeSlice> Bars { get; set; } | ||
|
||
[JsonProperty("beats")] | ||
public List<AnalysisTimeSlice> Beats { get; set; } | ||
|
||
[JsonProperty("meta")] | ||
public AnalysisMeta Meta { get; set; } | ||
|
||
[JsonProperty("sections")] | ||
public List<AnalysisSection> Sections { get; set; } | ||
|
||
[JsonProperty("segments")] | ||
public List<AnalysisSegment> Segments { get; set; } | ||
|
||
[JsonProperty("tatums")] | ||
public List<AnalysisTimeSlice> Tatums { get; set; } | ||
|
||
[JsonProperty("track")] | ||
public AnalysisTrack Track { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters