[racket] RSound trouble with rs-write

From: Robert Matovinovic (robert.matovinovic at web.de)
Date: Thu Oct 24 06:20:31 EDT 2013


I'm experimenting with the rsound package and ran into a problem. I can play
the sound but I can't write it into a wav file with rs-write.

Here a little code to reproduce the error on my machine Thinkpad, Windows 7,


#lang racket

(require (planet clements/rsound:4:4))


; setting of host-api for sound otherwise no sound is heard

(host-api 'paMME)

; sample rate for host-api set in OS settings

(define frame-rate 44100)


(define tone (make-tone 440 1 frame-rate))


(play tone)

(rs-write tone "test-tone")



(rsound #<s16vector> 0 44100 44100.0)


integer->integer-bytes: contract violation

  expected: exact-integer?

  given: 44100.0

  argument position: 1st

  other arguments...:





The error seems strange to me, since frame-rate is an exact integer, but
obviously is changed into a real by make-tone. Is there any help?


Best regards




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20131024/f979de66/attachment-0001.html>

Posted on the users mailing list.