Added capability information
This commit is contained in:
+26
-1
@@ -10,6 +10,7 @@
|
||||
racket/contract
|
||||
racket/string
|
||||
racket/path
|
||||
racket-mimetypes
|
||||
)
|
||||
|
||||
(provide audio-open
|
||||
@@ -24,6 +25,8 @@
|
||||
make-audio-reader
|
||||
audio-handle?
|
||||
audio-supported-extensions
|
||||
audio-supported-formats
|
||||
audio-decoder-for-extension
|
||||
current-opusfile-output-format
|
||||
opusfile-output-format?
|
||||
)
|
||||
@@ -107,6 +110,20 @@
|
||||
(define (audio-supported-extensions)
|
||||
known-extensions)
|
||||
|
||||
(define/contract (audio-supported-formats)
|
||||
(-> (listof
|
||||
(cons/c string?
|
||||
string?)))
|
||||
(for/list ((extension
|
||||
(in-list known-extensions)))
|
||||
(cons
|
||||
extension
|
||||
(mimetype-for-ext
|
||||
(string-append "audio."
|
||||
extension)
|
||||
#:default
|
||||
"application/octet-stream"))))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Register audio reader
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
@@ -268,6 +285,14 @@
|
||||
(cons 'wma 'ffmpeg)
|
||||
(cons 'matroska 'ffmpeg))))
|
||||
|
||||
(define/contract (audio-decoder-for-extension extension)
|
||||
(-> (or/c string? symbol?)
|
||||
(or/c #f symbol?))
|
||||
(hash-ref
|
||||
reader-for-kind
|
||||
(audio-format-for-extension extension)
|
||||
#f))
|
||||
|
||||
|
||||
|
||||
(define (find-reader audio-file)
|
||||
@@ -286,4 +311,4 @@
|
||||
) ; end of module
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user