This commit is contained in:
zuoban
2024-10-18 21:08:01 +08:00
parent 62883ccb99
commit 539f6d9ef5

View File

@@ -6,7 +6,6 @@ import (
"crypto/sha256"
"encoding/base64"
"encoding/json"
"errors"
"fmt"
"github.com/google/uuid"
"github.com/sirupsen/logrus"
@@ -50,10 +49,6 @@ const (
defaultStyle = "general"
)
var (
errEndpoint = errors.New("failed to get endpoint")
)
// GetEndpoint 获取语音合成服务的端点信息
func GetEndpoint() (map[string]interface{}, error) {
signature := Sign(endpointURL)
@@ -221,16 +216,3 @@ func VoiceList() ([]interface{}, error) {
return result, nil
}
func ByteCountIEC(b int64) string {
const unit = 1024
if b < unit {
return fmt.Sprintf("%d B", b)
}
div, exp := int64(unit), 0
for n := b / unit; n >= unit; n /= unit {
div *= unit
exp++
}
return fmt.Sprintf("%.1f %ciB", float64(b)/float64(div), "KMGTPE"[exp])
}