Revert "feat(audio): replace SysLog with logger for improved logging in GetAudioDuration"
This reverts commit 2a980bbcf5.
This commit is contained in:
@@ -6,7 +6,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"github.com/QuantumNous/new-api/logger"
|
|
||||||
"github.com/abema/go-mp4"
|
"github.com/abema/go-mp4"
|
||||||
"github.com/go-audio/aiff"
|
"github.com/go-audio/aiff"
|
||||||
"github.com/go-audio/wav"
|
"github.com/go-audio/wav"
|
||||||
@@ -20,7 +19,7 @@ import (
|
|||||||
// GetAudioDuration 使用纯 Go 库获取音频文件的时长(秒)。
|
// GetAudioDuration 使用纯 Go 库获取音频文件的时长(秒)。
|
||||||
// 它不再依赖外部的 ffmpeg 或 ffprobe 程序。
|
// 它不再依赖外部的 ffmpeg 或 ffprobe 程序。
|
||||||
func GetAudioDuration(ctx context.Context, f io.ReadSeeker, ext string) (duration float64, err error) {
|
func GetAudioDuration(ctx context.Context, f io.ReadSeeker, ext string) (duration float64, err error) {
|
||||||
logger.LogInfo(ctx, fmt.Sprintf("GetAudioDuration: ext=%s", ext))
|
SysLog(fmt.Sprintf("GetAudioDuration: ext=%s", ext))
|
||||||
// 根据文件扩展名选择解析器
|
// 根据文件扩展名选择解析器
|
||||||
switch ext {
|
switch ext {
|
||||||
case ".mp3":
|
case ".mp3":
|
||||||
@@ -45,7 +44,7 @@ func GetAudioDuration(ctx context.Context, f io.ReadSeeker, ext string) (duratio
|
|||||||
default:
|
default:
|
||||||
return 0, fmt.Errorf("unsupported audio format: %s", ext)
|
return 0, fmt.Errorf("unsupported audio format: %s", ext)
|
||||||
}
|
}
|
||||||
logger.LogInfo(ctx, fmt.Sprintf("GetAudioDuration: duration=%f", duration))
|
SysLog(fmt.Sprintf("GetAudioDuration: duration=%f", duration))
|
||||||
return duration, err
|
return duration, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user