Daniel van den Eijkel schrieb:

> Using forkIO makes no difference. I tried the following code (and some
> variations) but the program still hangs after ca. 40sec at a sampling
> rate11025 and ca. 10 sec at 44100. Maybe I'm doing something wrong. But
> now I need a break before the next attempt, can't hear this saw anymore :-)
>
> extended write srcOpts dstOpts sampleRate stream = do
>    mvar <- newEmptyMVar
>    bracket
>       (Proc.runInteractiveProcess "play"
>           (Args.decons $ mconcat $
>            OptPriv.toArguments
>              (mconcat $
>               srcOpts :
>               Option.numberOfChannels
>                  (Frame.withSignal Frame.numberOfChannels stream) :
>               Option.sampleRate sampleRate :
>               Option.format (Frame.withSignal Frame.format stream) :
>               []) :
>            Args.pipe :
>            OptPriv.toArguments dstOpts :
>            [])
>           Nothing Nothing)
>       (\(input,output,err,_proc) ->
>           mapM_ IO.hClose [input, output, err])
>       (\(input,_,_,proc) -> do
>          -- hSetBuffering input (BlockBuffering Nothing)
>          -- hSetBinaryMode input True
>          forkIO $ do write input stream
>                      xcode <- Proc.waitForProcess proc
>                      putMVar mvar xcode
>                      --putStrLn "done"
>                      return ()
>          readMVar mvar)

Hm, complicated. Did you try the Write module in the same way? Does it
also hang? Did you try to write a file with StorableVector.hPut directly?
_______________________________________________
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art

Reply via email to