[racket] RSound trouble with rs-write

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

Hello,

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,
64bit:

 

#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))

tone

(play tone)

(rs-write tone "test-tone")

 

Output:

(rsound #<s16vector> 0 44100 44100.0)

Error:

integer->integer-bytes: contract violation

  expected: exact-integer?

  given: 44100.0

  argument position: 1st

  other arguments...:

   4

   #f

   #f

 

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

Robert

 

 

-------------- 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.