Note that there are some explanatory texts on larger screens.

plurals
  1. POwaveOutPrepareHeader returns INVALPARAMS
    primarykey
    data
    text
    <p>I've been trying to track this down for a while but I'm at a loss as to where to look next. Whenever I call waveOutPrepareHeader() I get INVALPARAMS indicating "The buffer's base address is not aligned with the sample size." </p> <p>I am currently preparing my header from the data after the "data" tag (and length) from the file using the method found via MSDN.</p> <pre><code> public Wave.SystemError Read(BinaryReader rdr, uint readLength) { dwBufferLength = readLength; byte[] data = new byte[readLength]; rdr.Read(data, 0, data.Length); if (lpData == IntPtr.Zero) lpData = Memory.LocalAlloc(Memory.LMEM_FIXED, (uint)data.Length); if (lpData == IntPtr.Zero) return Wave.SystemError.NOMEM; Marshal.Copy(data, 0, lpData, data.Length); return Wave.SystemError.NOERROR; } </code></pre> <p>All the parameters of the class are zeroed out before use, after calling this function on a wave file I get</p> <pre><code>dwBufferLength = 32768 dwBytesRecorded = 0 dwFlags = 0 dwLoops = 0 dwUser = 0 lpData = 384656 lpNext = 0 reserved = 0 </code></pre> <p>when passed into </p> <pre><code>return waveOutPrepareHeader(hWaveOut, ref headerBuffer[buffIndex], (uint)Marshal.SizeOf(headerBuffer[buffIndex])); </code></pre> <p>where headerBuffer[buffIndex] is the abovementioned WAVEHDR I get 11 (MMSYSERR_INVALPARAM). I've checked and my hWaveOut and size seems to be sane so I'm forced to conclude the problem is with the header but I can't figure out what is wrong or even what to check. </p> <p>What do I need to do to fix this error, or failing that, what can I check to see what is causing it? Any assistance would be greatly appreciated</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload