main.go 309 B

123456789101112131415161718
  1. package duration
  2. import (
  3. "fmt"
  4. "os"
  5. tag "github.com/dhowden/tag"
  6. )
  7. func GetSongDurationSeconds(file *os.File, tags tag.Metadata) int {
  8. switch tags.Format() {
  9. case "VORBIS":
  10. return GetSongDurationSecondsVorbis(file)
  11. default:
  12. fmt.Printf("Unrecognised format: %s\n", tags.Format())
  13. return 0
  14. }
  15. }