felix
(felix Lacquemen)
April 5, 2024, 3:52pm
#1
Hi !
I’m encoutering a problem with writting an audio file to the disk.
I want to have a mono file encoded in 24bit to use it in CDP analysing it with PVOC Anal and then use it in a program like Spectwin. To achieve this the two analysis files need to have the same bit definition or I get an error message.
My first sound used is written with reaper and the second one comes from csound. But whatever I try in the command line its always encoded in 16bits. My csd is executed from CsoundQt but I get the same thing when I execute it from a terminal.
Here is the begining of my csd:
-B 256
-b 128
-3
–output=C:\Users\felix\Desktop\PAUL_ET_MELI\SONS_TO_INTERLEAVE\BassSynth_2.wav
sr = 44100
ksmps = 64
nchnls = 1
0dbfs = 1
Hope it’s not too confuse. I know it sounds dumb but it’s been one hour I’m stuck with that and I can’t understand the problem.
Have a good day,
Félix
–format=24bit
Use “csound --help” from the terminal or check the manual: http://www.csounds.com/manual/html/CommandFlags.html
felix
(felix Lacquemen)
April 5, 2024, 5:32pm
#3
Thanks for your response,
I already tried the flags: --fromat=24bit or -3 with no results
Also, when I don’t write the file extension explicitly and want to specify it using the --format=type flag the file is still written with no header.
As if the flags for the output on the disk weren’t working for me…
ST_Music
(ST Music)
April 6, 2024, 7:20am
#4
That is rather odd. The following works perfectly for me on Android, Windows & Mac:
-o filename.wav --format=24bit
or
-o filename.wav --format=float
for 32 bit float.
If you still can’t get that to work you could try fout and if needed the monitor opcode. Here’s an ex:
<CsoundSynthesizer>
<CsOptions>
-odac
; -o filename.wav --format=24bit
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1
instr Play
iFreq ftgen 1, 0, 0, 2, 220, 440, 880
aSig = oscil:a(line:a(.4,p3,0),tab:k(lfo(randomh:k(0,2,4),4,3),1))
outs(aSig, aSig)
endin
instr Monitor, Record
aL, aR monitor
; iformat = type * 10 + sample format
; 14 = wav, 16 bit
; 18 = wav, 24 bit
; 16 = wav, 32 bit float
iFormat = 18
fout "/dir/filename.wav", iFormat, aL, aR
endin
</CsInstruments>
<CsScore>
i"Play" 0 16
i"Monitor" 0 16
</CsScore>
</CsoundSynthesizer>