It's likely just overloading and clipping on the output file.  WvOut
and WvOut2 must quantize to 16 bits to write out the file.  So 
numbers that are greater than +/- 1.0 will overload.  If this is
really the problem (likely), then there's an easy fix.  There's a
method called fileGain() that sets an extra gain before the file
is written out.  The default is of course 1.0, but you can change
it to anything.  Example useage:


MyPatch => WvOut bob => blackhole;
"mywavfile.wav" => bob.wavFilename;

0.5 => bob.fileGain;       // This is your friend for writing non-clipped files

while (now < then)  {
    // do whatever;
}

bob.closeFile();


Hope this helps.  If not let us know and we'll dig deeper.

PRC


> On Jan 24, 2015, at 9:00 AM, [email protected] wrote:
> 
> Send chuck-users mailing list submissions to
>       [email protected]
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>       https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
> or, via email, send a message with subject or body 'help' to
>       [email protected]
> 
> You can reach the person managing the list at
>       [email protected]
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of chuck-users digest..."
> 
> 
> Today's Topics:
> 
>   1. WvOut  sample size (????????? ????????)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Fri, 23 Jan 2015 20:22:21 +0100
> From: ????????? ????????      <[email protected]>
> To: [email protected]
> Subject: [chuck-users] WvOut  sample size
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset=utf-8; format=flowed
> 
> Hello,
> I am a new member of this list.
> I have made some ChucK program that sounds good when performed by ChucK 
> VM. However, when I record this music through WvOut in to file and later 
> play recorded file using system player, I hear some cracks (distortions, 
> noise).
> It seems to me that it is some conversion taking place during recording. 
> In  the documentation of WvOut class it is suggested that MATLAB file 
> format will write 64-bit floats. But even with that precision I get the 
> same sound in file. I have looked in to the source code and found that 
> every method of WvOut class (WvOut_ctrl_<filetype>Filename) opens file 
> with the same 16-bit sample-size (Stk::STK_SINT16).
> 
> I have tried naively to change that parameter into Stk::STK_SINT32, and 
> recompiled successfully ChucK, but the quality of recorded sound was not 
> improved. Actually, file was again 16-bit signed encoded.
> 
> What can I do to improve quality of recording.
> 
> My computer is amd-64 Ubuntu 14.04. I have compiled ChucK with 'make 
> linux-alsa' command.
> 
> PS: I tried to record sound from system sound-card by using some other 
> programs for recording, but with no success. Either ChucK could not 
> access sound-card or a recording program could not access sound-card. It 
> seems that ChucK insists on having exclusive rights over sound-card and 
> doesn't want to share it with other programs. Even if in my browser is 
> opened some site that uses sound, ChucK refuses to start.
> 
> Vitalije
> 
> 
> ------------------------------
> 
> _______________________________________________
> chuck-users mailing list
> [email protected]
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
> 
> 
> End of chuck-users Digest, Vol 114, Issue 4
> *******************************************

_______________________________________________
chuck-users mailing list
[email protected]
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users

Reply via email to