]> gitweb.factorcode.org Git - factor.git/commitdiff
audio.aiff: one liner.
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 16 Mar 2021 15:13:04 +0000 (08:13 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 16 Mar 2021 15:13:48 +0000 (08:13 -0700)
extra/audio/aiff/aiff.factor

index 072d700965bf7dde546624d0a28c99785882d136..3fd5dbdacf845bc64f2aee3f9df9f0d985e8b144 100644 (file)
@@ -35,8 +35,7 @@ STRUCT: sound-data-chunk
 
 ! cheesy long-double>integer converter that assumes the long double is a positive integer
 : sample-rate>integer ( byte[10] -- sample-rate )
-    [ 2 tail-slice be> ]
-    [ 2 head-slice be> 16383 - 63 - ] bi shift ;
+    2 cut-slice [ be> ] bi@ swap 16383 - 63 - shift ;
 
 : read-form-chunk ( -- byte-array/f )
     form-chunk heap-size ensured-read* ;