Csound Csound-dev Csound-tekno Search About

writing dac output to a file

Date2005-10-01 08:52
Fromsokratesla
Subjectwriting dac output to a file
AttachmentsNone  None  

Date2005-10-01 10:16
FromIstvan Varga
SubjectRe: writing dac output to a file
sokratesla wrote:

> # How can I write the realtime output of Csound to a file? I use -o dac6 
> flag to realtime audio (6 is my asio4all driver). And have tried 
> soundout opcode and outs opcode in same instrument:
>  
> instr 1
> ...
> soundout asig, "c:\\song.wav"
> outs asig, asig
> endin
>  
> But mediaplayer didn't play this wav file.

soundout and soundouts write a raw sound file without a header.
If you use
   fout "C:\\song.wav", 2, asig
instead, it will write the file in the same format as the one specified
for -o (that is, WAV if the -W command line flag is used); also, fout
can write more than 2 channels. It does have disadvantages, though,
because it can only write 16 bit files with a header (this limitation
may be removed easily), and is somewhat slower than soundout/soundouts.