Skip to content

Commit

Permalink
fix: 修复错误 (#123)
Browse files Browse the repository at this point in the history
* 简化代码 & 修复错误

* fix: 修复错误

* fix: 修复错误
  • Loading branch information
icarus-ai authored Nov 14, 2024
1 parent 83b888a commit 1e27903
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions message/elements.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1e27903

Please sign in to comment.