Record sound: Difference between revisions
Content deleted Content added
Nimrod -> Nim |
No edit summary |
||
Line 257: | Line 257: | ||
while( true ) 1::second => now;</lang> |
while( true ) 1::second => now;</lang> |
||
=={{header|Common Lisp}}== |
|||
{{trans|C}} |
|||
<lang lisp> |
|||
(defun record (n) |
|||
(with-open-file (in "/dev/dsp" :element-type '(unsigned-byte 8)) |
|||
(loop repeat n collect (read-byte in)) |
|||
) |
|||
) |
|||
(defun play (byte-list) |
|||
(with-open-file (out "/dev/dsp" :direction :output :element-type '(unsigned-byte 8) :if-exists :append) |
|||
(mapcar (lambda (b) (write-byte b out)) byte-list) |
|||
) |
|||
) |
|||
(play (record 65536)) |
|||
</lang> |
|||
=={{header|GUISS}}== |
=={{header|GUISS}}== |