main.go 339 B

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