Possible bug on AddIntoMemoryStream

Posted by rnd_j on
URL: http://uos-forum.108.s1.nabble.com/Possible-bug-on-AddIntoMemoryStream-tp1482.html

Hello Fred,

Thank you for your hard work developing and maintaining this library.

I think there's a bug on uos_flat (or a mismatch between it and the SimpleRecorder example).

I'm writing a piece of code that requires capturing audio to a stream.
I disabled other default outputs, and uncommented the corresponding lines on the SimpleRecorder examples:

      // saving in a Memory-Stream:
      if thememorystream = nil then thememorystream := tmemorystream.create;
      uos_AddIntoMemoryStream(PlayerIndex1, (thememorystream),-1,-1,-1,-1);

...but nothing was being recorded (the stream length stayed at 0).

Apparently, using "-1" as parameter for AudioFormat is not interpreted as "use the default".
If I explicitly use 0 (for wav, or 1, for ogg),  recording to a stream works fine.

Working on Windows using Lazarus 3.8 / FPC 3.2.2

Thanks!

J