5TP2HRK2Z7QHYGTDZXTDADY2TLBIT4SAOOJK6K5IO2B4QJW7LURAC Segments int `json:"segments"`Species map[string]int `json:"species"`
Segments int `json:"segments"`Species map[string]int `json:"species"`Calltypes map[string]map[string]int `json:"calltypes,omitempty"` // species -> calltype -> count
// extractRelativePath extracts the .wav filename from a .data file path// e.g., "/folder/tx51_LISTENING_20260221_203004.WAV.data" -> "tx51_LISTENING_20260221_203004.wav"
// extractRelativePath extracts the audio filename from a .data file path// e.g., "/folder/tx51_LISTENING_20260221_203004.WAV.data" -> "tx51_LISTENING_20260221_203004.WAV"// Preserves the original case of the extension as-is.
}// Remove .data extensionfilename = strings.TrimSuffix(filename, ".data")// Normalize extension to lowercase .wavlower := strings.ToLower(filename)if strings.HasSuffix(lower, ".wav") {// Already has .wav/.WAV extension, just normalize to lowercasereturn filename[:len(filename)-4] + ".wav"