Feat: 获取&写入 音频文件的 Metadata #43

Merged
um-dev merged 13 commits from feat/audio-meta into master 2022-12-06 17:55:19 +00:00
Showing only changes of commit 3857ba91a6 - Show all commits

View File

@ -27,6 +27,17 @@ func (r *Result) getTagByKey(key string) string {
return v
}
}
for _, stream := range r.Streams { // try to find in streams
if stream.CodecType != "audio" {
continue
}
for k, v := range stream.Tags {
if key == strings.ToLower(k) {
return v
}
}
}
return ""
}
func (r *Result) GetTitle() string {
@ -81,6 +92,7 @@ type Stream struct {
StartTime string `json:"start_time"`
BitRate string `json:"bit_rate"`
Disposition *ProbeDisposition `json:"disposition"`
Tags map[string]string `json:"tags"`
}
type ProbeDisposition struct {