<div dir="ltr">Hello,<div><br></div><div>I manage to successfully write 8, 16 and 24 bit, all stereo, FLAC files. But when I try to write 32 bit FLACs my program crashes.</div><div><br></div><div><b>FLAC__stream_encoder_set_bits_per_sample </b>is called to match the desired bit depth (8, 16, 24, 32)</div><div><br></div><div>It's the same code for all bit depths, i provide a fixed-size signed int buffer to the lib (size=16384), with values with appropriate ranges for each bit depth (-128...+127 for 8 bit, etc.).</div><div><br></div><div>The crash happens in stream_encoder.c line 2263 :</div><div><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><b>encoder->private_->integer_signal[channel][i] = buffer[k++];</b></div><div><br></div></blockquote>

<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">It happens when I call </span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><b>FLAC__stream_encoder_process_interleaved</b></span><span style="text-align:start;text-indent:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><b>(encoder, out, 16384/2)</b> in my code. Its working perfectly for all bit depth except 32 bit.</span><div><div><br><div>

<br>Output message: Unhandled exception at 0x00F98441 in fmcomposer.exe: 0xC0000005: Access violation writing location 0x00000000.<div><br></div><div><br></div><div>I'm using the latest code from the github repository. Reading the docs didn't noticed any thing special to do for writing 32 bit FLACs, it seems it should be supported. Maybe I am missing something ?</div><div><br></div><div><br></div><div><br></div><div>Regards</div><div><br></div><div>Stéphane</div></div></div></div></div>