Csound Csound-dev Csound-tekno Search About

Playable audio from fout opcode

Date2017-05-01 22:11
FromSam Smalley
SubjectPlayable audio from fout opcode
So I'm trying to use fout to output each instrument's audio separately. As practice I set up a simple sin instrument, however the outputted file does not have any audio. Is this a header issue? Are the parameters that I've used for fout incorrect? Here's the code in question:



-odac



sr = 44100
ksmps = 128
nchnls = 2
0dbfs = 1.0

instr 1

	aOsc1 oscil 0.5, 440
	fout "sin.wav", 0, aOsc1
	outs aOsc1, aOsc1
	
endin



i 1 0 3



Thanks,
Sam

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2017-05-01 23:28
FromEmmett Palaima
SubjectRe: Playable audio from fout opcode
You are giving the file the .wav extension, but giving fout a value of 0 for iformat (2nd argument), which signifies a headerless (raw audio) file format. 

Try changing iformat to 2 or greater. Also take a look at the --wave and --aiff headers. Not sure if those are what you need, but try those if changing iformat alone does not work.



On Mon, May 1, 2017 at 5:11 PM, Sam Smalley <ssmalley@berklee.edu> wrote:
So I'm trying to use fout to output each instrument's audio separately. As practice I set up a simple sin instrument, however the outputted file does not have any audio. Is this a header issue? Are the parameters that I've used for fout incorrect? Here's the code in question:

<CsoundSynthesizer>
<CsOptions>
-odac
</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 128
nchnls = 2
0dbfs = 1.0

instr 1

        aOsc1 oscil 0.5, 440
        fout "sin.wav", 0, aOsc1
        outs aOsc1, aOsc1

endin
</CsInstruments>
<CsScore>

i 1 0 3
</CsScore>
</CsoundSynthesizer>

Thanks,
Sam

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here