title: FMOD CreateSound with a user-created stream
body: <p>Given a DLL that's supposed to play SNES SPC files and FMOD, in C#, why does this call to <code>system.createSound</code> fail?</p>
  
  <pre><code>var ret = system.init(32, FMOD.INITFLAGS.NORMAL, (IntPtr)null);
  var soundEx = new FMOD.CREATESOUNDEXINFO()
  {
      cbsize = Marshal.SizeOf(soundEx),
      fileoffset = 0,
      length = ~0U,
      numchannels = 2,
      defaultfrequency = 32000,
      format = FMOD.SOUND_FORMAT.PCM16,
      pcmreadcallback = pcmreadcallback,
      pcmsetposcallback = pcmsetposcallback,
      dlsname = null,
  };
  var mode = FMOD.MODE.DEFAULT | FMOD.MODE.OPENUSER
           | FMOD.MODE.LOOP_NORMAL | FMOD.MODE.CREATESTREAM;
  ret = system.createSound((string)null, mode, ref soundEx, ref sound);
  //^-- ERR_INVALID_PARAM
  ret = system.playSound(FMOD.CHANNELINDEX.FREE, sound, false, ref channel);
  </code></pre>
  
  <p>Compare that with the <code>usercreatedsound</code> sample that comes with FMOD:</p>
  
  <pre><code>FMOD.MODE mode = (FMOD.MODE._2D | FMOD.MODE.DEFAULT
                 | FMOD.MODE.OPENUSER | FMOD.MODE.LOOP_NORMAL
                 | FMOD.MODE.HARDWARE);
  //snip
  createsoundexinfo.cbsize            = Marshal.SizeOf(createsoundexinfo);
  createsoundexinfo.fileoffset        = 0;
  createsoundexinfo.length            = frequency * channels * 2 * 2;
  createsoundexinfo.numchannels       = (int)channels;
  createsoundexinfo.defaultfrequency  = (int)frequency;
  createsoundexinfo.format            = FMOD.SOUND_FORMAT.PCM16;
  createsoundexinfo.pcmreadcallback   = pcmreadcallback;
  createsoundexinfo.pcmsetposcallback = pcmsetposcallback;
  createsoundexinfo.dlsname           = null;
  //snop
  result = system.createSound(
      (string)null, 
      (mode | FMOD.MODE.CREATESTREAM), 
      ref createsoundexinfo,
      ref sound);
  </code></pre>
  
  <p>Length, frequency... doesn't matter.</p>
  
  <p>Edit: I've already confirmed that the SPC player works, at least as far as initialization goes, and the sample that came with FMOD builds and runs just fine. <em>The only particularly meaningful change, aside from twiddling the settings in an attempt to get it to run, is writing it in 4.0 style.</em></p>