diff --git a/README.md b/README.md index b671eff2..f9fce78c 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ You can update the used quota using the API key of any token, allowing other con ### Support OpenAI O1/O1-mini/O1-preview -- [feat: add openai o1](https://github.com/songquanpeng/one-api/pull/1990) +- [feat: add openai o1 #1990](https://github.com/songquanpeng/one-api/pull/1990) ### Get request's cost @@ -98,4 +98,4 @@ type UserRequestCost struct { ### Whisper's transcription only charges for the length of the input audio -- [feat(audio): count whisper-1 quota by audio duration](https://github.com/Laisky/one-api/pull/21) +- [feat(audio): count whisper-1 quota by audio duration #2022](https://github.com/songquanpeng/one-api/pull/2022) diff --git a/common/helper/audio.go b/common/helper/audio.go index f3230cbb..b5b1acf8 100644 --- a/common/helper/audio.go +++ b/common/helper/audio.go @@ -3,7 +3,6 @@ package helper import ( "bytes" "context" - "fmt" "io" "os" "os/exec" @@ -30,13 +29,6 @@ func SaveTmpFile(filename string, data io.Reader) (string, error) { // GetAudioDuration returns the duration of an audio file in seconds. func GetAudioDuration(ctx context.Context, filename string) (float64, error) { - // print file info for debug - fstat, err := os.Stat(filename) - if err != nil { - return 0, errors.Wrap(err, "failed to get audio duration") - } - fmt.Printf("file name: %s, size: %d\n", filename, fstat.Size()) - // ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 {{input}} c := exec.CommandContext(ctx, "/usr/bin/ffprobe", "-v", "error", "-show_entries", "format=duration", "-of", "default=noprint_wrappers=1:nokey=1", filename) output, err := c.Output()