Paste: music debug help

Author: typemore
Mode: factor
Date: Tue, 21 Sep 2010 05:14:34
Plain Text |
M: noise-generator generator-audio-format
    drop 1 16 8000 ;
M: noise-generator generate-audio
    drop
    4000 iota [ 18 / 3.1415926 * 2 * sin 4096 * ] short-array{ } map-as
    8000 ;
M: noise-generator dispose
    drop ;

:: audio-test ( -- )
    0 :> i!
    f 4 <audio-engine> :> engine
    engine start-audio*

    engine T{ audio-source f { -1.0 0.0 0.0 } 1.0 { 1.0 0.0 0.0 } f } noise-generator new 2
        play-streaming-audio-clip :> noise-clip

    [
        noise-clip source>>
        drop
        engine update-audio
    ] 20 milliseconds every :> timer
    "Press Enter to stop the test." print
    readln drop
    timer stop-timer
    engine dispose ;

New Annotation

Summary:
Author:
Mode:
Body: