Full conversion done

This commit is contained in:
2026-06-25 21:52:17 +02:00
parent f175ac69b6
commit 7a742fcda9
8 changed files with 637 additions and 331 deletions
+29
View File
@@ -0,0 +1,29 @@
#lang racket/base
(require racket-audio/audio-encoder
"log.rkt"
"util.rkt"
simple-ini
)
(provide convert-to-opus
)
(define (convert-to-opus flac-in opus-out ini)
(let* ((opus-kbps (ini-get ini 'opus 'kbps 224))
(settings (hash 'bitrate (* opus-kbps 1000)
'vbr #t))
)
(with-handlers ([exn? (λ (e)
(err-am (format "~a" e))
(when (file-exists? opus-out)
(delete-file opus-out))
#f)])
(let ((result (audio-encode flac-in opus-out
settings
#:encoder 'opus
#:copy-tags? #t)))
#t)
)
)
)