diff --git a/message/elements.go b/message/elements.go index 8ca2fe2..d78e9b0 100644 --- a/message/elements.go +++ b/message/elements.go @@ -204,8 +204,7 @@ func NewStreamRecord(r io.ReadSeeker, summary ...string) *VoiceElement { Md5: md5, Sha1: sha1, Duration: func() uint32 { - info, err := audio.Decode(r) - if err != nil { + if info, err := audio.Decode(r); err == nil { return uint32(info.Time) } return uint32(length)