MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / CountAudioTokenInput

Function CountAudioTokenInput

service/token_counter.go:439–448  ·  view source on GitHub ↗
(audioBase64 string, audioFormat string)

Source from the content-addressed store, hash-verified

437}
438
439func 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
450func CountAudioTokenOutput(audioBase64 string, audioFormat string) (int, error) {
451 if audioBase64 == "" {

Callers 1

CountTokenRealtimeFunction · 0.85

Calls 1

parseAudioFunction · 0.85

Tested by

no test coverage detected