AIAngel2 / analysis_schema.json
airosss's picture
Update analysis_schema.json
ad11b49 verified
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://aiangel/schema/voice-analysis/1.x",
"title": "AI Angel Voice Analysis v1.x",
"description": "Единая схема, принимающая JSON формата 1.0 и 1.1.",
"anyOf": [
{
"title": "v1.0",
"type": "object",
"required": ["version", "aggregates", "words", "transcript"],
"properties": {
"version": { "type": "string", "const": "1.0" },
"aggregates": {
"type": "object",
"required": [
"duration_sec","voiced_duration_sec","voiced_ratio","rms_dbfs_mean",
"f0_mean_hz","f0_median_hz","f0_std_hz","f0_stability",
"words_count","speech_rate_wps","vad"
],
"properties": {
"duration_sec": { "type": "number", "minimum": 0 },
"voiced_duration_sec": { "type": "number", "minimum": 0 },
"voiced_ratio": { "type": "number", "minimum": 0, "maximum": 1 },
"rms_dbfs_mean": { "type": ["number","null"] },
"f0_mean_hz": { "type": ["number","null"], "minimum": 0 },
"f0_median_hz": { "type": ["number","null"], "minimum": 0 },
"f0_std_hz": { "type": ["number","null"], "minimum": 0 },
"f0_stability": { "type": ["number","null"], "minimum": 0, "maximum": 1 },
"words_count": { "type": "integer", "minimum": 0 },
"speech_rate_wps": { "type": "number", "minimum": 0 },
"vad": { "type": "string" }
},
"additionalProperties": false
},
"words": {
"type": "array",
"items": {
"type": "object",
"required": [
"start_s","end_s","duration_s","pre_pause_ms","word","prob",
"f0_mean_hz","f0_z","rms_dbfs","rms_z",
"accent_score","accent_flag","speed_local_sylps","duration_z"
],
"properties": {
"start_s": { "type": "number", "minimum": 0 },
"end_s": { "type": "number", "minimum": 0 },
"duration_s": { "type": "number", "minimum": 0 },
"pre_pause_ms": { "type": "integer", "minimum": 0 },
"word": { "type": "string" },
"prob": { "type": ["number","null"], "minimum": 0, "maximum": 1 },
"f0_mean_hz": { "type": ["number","null"], "minimum": 0 },
"f0_z": { "type": ["number","null"] },
"rms_dbfs": { "type": ["number","null"] },
"rms_z": { "type": ["number","null"] },
"accent_score": { "type": "number", "minimum": 0, "maximum": 1 },
"accent_flag": { "type": "integer", "enum": [0,1] },
"speed_local_sylps": { "type": ["number","null"], "minimum": 0 },
"duration_z": { "type": ["number","null"] }
},
"allOf": [
{
"if": { "required": ["start_s","end_s"] },
"then": { "properties": { "end_s": { "minimum": { "$data": "1/start_s" } } } }
}
],
"additionalProperties": false
}
},
"transcript": { "type": "string" }
},
"additionalProperties": false
},
{
"title": "v1.1",
"type": "object",
"required": ["version", "aggregates", "words", "transcript"],
"properties": {
"version": { "type": "string", "const": "1.1" },
"aggregates": {
"type": "object",
"required": [
"duration_sec","voiced_duration_sec","voiced_ratio","rms_dbfs_mean",
"f0_mean_hz","f0_median_hz","f0_std_hz","f0_stability",
"pitch_confidence_mean",
"words_count","speech_rate_wps","vad"
],
"properties": {
"duration_sec": { "type": "number", "minimum": 0 },
"voiced_duration_sec": { "type": "number", "minimum": 0 },
"voiced_ratio": { "type": "number", "minimum": 0, "maximum": 1 },
"rms_dbfs_mean": { "type": ["number","null"] },
"f0_mean_hz": { "type": ["number","null"], "minimum": 0 },
"f0_median_hz": { "type": ["number","null"], "minimum": 0 },
"f0_std_hz": { "type": ["number","null"], "minimum": 0 },
"f0_stability": { "type": ["number","null"], "minimum": 0, "maximum": 1 },
"pitch_confidence_mean": { "type": ["number","null"], "minimum": 0, "maximum": 1 },
"words_count": { "type": "integer", "minimum": 0 },
"speech_rate_wps": { "type": "number", "minimum": 0 },
"vad": { "type": "string" }
},
"additionalProperties": false
},
"words": {
"type": "array",
"items": {
"type": "object",
"required": [
"start_s","end_s","duration_s","pre_pause_ms","word","prob",
"f0_mean_hz","f0_z","rms_dbfs","rms_z",
"accent_score","accent_flag","speed_local_sylps","duration_z",
"pitch_confidence"
],
"properties": {
"start_s": { "type": "number", "minimum": 0 },
"end_s": { "type": "number", "minimum": 0 },
"duration_s": { "type": "number", "minimum": 0 },
"pre_pause_ms": { "type": "integer", "minimum": 0 },
"word": { "type": "string" },
"prob": { "type": ["number","null"], "minimum": 0, "maximum": 1 },
"f0_mean_hz": { "type": ["number","null"], "minimum": 0 },
"f0_z": { "type": ["number","null"] },
"rms_dbfs": { "type": ["number","null"] },
"rms_z": { "type": ["number","null"] },
"accent_score": { "type": "number", "minimum": 0, "maximum": 1 },
"accent_flag": { "type": "integer", "enum": [0,1] },
"speed_local_sylps": { "type": ["number","null"], "minimum": 0 },
"duration_z": { "type": ["number","null"] },
"pitch_confidence": { "type": ["number","null"], "minimum": 0, "maximum": 1 }
},
"allOf": [
{
"if": { "required": ["start_s","end_s"] },
"then": { "properties": { "end_s": { "minimum": { "$data": "1/start_s" } } } }
}
],
"additionalProperties": false
}
},
"transcript": { "type": "string" }
},
"additionalProperties": false
}
]
}