Go-based FM stereo transmitter with RDS, Windows-first and cross-platform
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

22 行
339B

  1. package rds
  2. import "strings"
  3. func normalizePS(ps string) string {
  4. ps = strings.ToUpper(ps)
  5. if len(ps) > 8 {
  6. ps = ps[:8]
  7. }
  8. if len(ps) < 8 {
  9. ps = ps + strings.Repeat(" ", 8-len(ps))
  10. }
  11. return ps
  12. }
  13. func normalizeRT(rt string) string {
  14. if len(rt) > 64 {
  15. rt = rt[:64]
  16. }
  17. return rt
  18. }