Re: Setting the sample rate in a WAV file

Joseph Anderson <[email protected]> Thu, 6 May 2021 14:15:26 -0700
Newsgroups gmane.comp.audio.supercollider.user
Message-ID <CANZDFkmuRsu=a+apX=ONr7azhzguQc_qBAG6qMbaYGUPHnuA_A@mail.gmail.com>
Will Signal:-write
<https://depts.washington.edu/dxscdoc/Help/Classes/Signal.html#-write> do
the job for you?

You'll need to install the SignalBox quark
<https://gitlab.com/dxarts/projects/SignalBox.quark>.


*Dr Joseph Anderson | Research Scientist*

DXARTS, Box 353414

University of Washington

Seattle, WA 98195-3680



http://www.dxarts.washington.edu


Subscribe to our events list <https://dxarts.washington.edu/mailing-list>
to receive email updates about lectures, performances, exhibitions and more.



On Thu, May 6, 2021 at 12:28 PM <[email protected]> wrote:

> Hello list,
>
>
>
> I have a process that creates signals at rates other than the server’s
> sample rate, and I want to save these signals using a custom UGen
> GatedDiskOut that writes a frame only on a trigger (very useful). But then
> I need to get the effective sample rate into the WAV file header, and I can
> ’t figure out how. I have tried buffer.sampleRate, but buffer.write and
> buffer.close both seem to ignore that, writing the server’s samplerate to
> the WAV header instead.  I also tried sf = Soundfile.new(path) followed by
> sf.sampleRate and sf.asBuffer to specify  the buffer,  but to no avail. Is
> there any way of creating and writing to a WAV file with a sample rate set
> to something different from the server’s?
>
>
>
> Thanks
>
>
>
> sternsc
>
>
>
>
>
>
>
>
>
>
>
>
>