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

Function CountAudioTokenOutput

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

Source from the content-addressed store, hash-verified

448}
449
450func CountAudioTokenOutput(audioBase64 string, audioFormat string) (int, error) {
451 if audioBase64 == "" {
452 return 0, nil
453 }
454 duration, err := parseAudio(audioBase64, audioFormat)
455 if err != nil {
456 return 0, err
457 }
458 return int(duration / 60 * 200 / 0.24), nil
459}
460
461//func CountAudioToken(sec float64, audioType string) {
462// if audioType == "input" {

Callers 1

CountTokenRealtimeFunction · 0.85

Calls 1

parseAudioFunction · 0.85

Tested by

no test coverage detected