Go-based FM stereo transmitter with RDS, Windows-first and cross-platform
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
728B

  1. package main
  2. import (
  3. "flag"
  4. "fmt"
  5. "log"
  6. "time"
  7. cfgpkg "github.com/jan/fm-rds-tx/internal/config"
  8. offpkg "github.com/jan/fm-rds-tx/internal/offline"
  9. )
  10. func main() {
  11. configPath := flag.String("config", "", "path to JSON config")
  12. out := flag.String("output", "", "output IQ file path")
  13. duration := flag.Duration("duration", 2*time.Second, "generation duration")
  14. flag.Parse()
  15. cfg, err := cfgpkg.Load(*configPath)
  16. if err != nil {
  17. log.Fatalf("load config: %v", err)
  18. }
  19. gen := offpkg.NewGenerator(cfg)
  20. if err := gen.WriteFile(*out, *duration); err != nil {
  21. log.Fatalf("offline generation failed: %v", err)
  22. }
  23. fmt.Println(gen.Summary(*duration))
  24. }