Full conversion done
This commit is contained in:
@@ -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)
|
||||
)
|
||||
)
|
||||
)
|
||||
Reference in New Issue
Block a user