(audioBase64 string, audioFormat string)
| 437 | } |
| 438 | |
| 439 | func CountAudioTokenInput(audioBase64 string, audioFormat string) (int, error) { |
| 440 | if audioBase64 == "" { |
| 441 | return 0, nil |
| 442 | } |
| 443 | duration, err := parseAudio(audioBase64, audioFormat) |
| 444 | if err != nil { |
| 445 | return 0, err |
| 446 | } |
| 447 | return int(duration / 60 * 100 / 0.06), nil |
| 448 | } |
| 449 | |
| 450 | func CountAudioTokenOutput(audioBase64 string, audioFormat string) (int, error) { |
| 451 | if audioBase64 == "" { |
no test coverage detected