Possible bug on AddIntoMemoryStream

Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Possible bug on AddIntoMemoryStream

rnd_j
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


Reply | Threaded
Open this post in threaded view
|

Re: Possible bug on AddIntoMemoryStream

fredvs
Administrator
Hello rnd_j and welcome in uos forum.

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

Ooops, indeed the default AudioFormat was not defined in AddIntoMemoryStream() of  uos.pas.

It was just fixed with last commit of https://github.com/fredvs/uos/

Thanks to note it.

Fre;D
Reply | Threaded
Open this post in threaded view
|

Re: Possible bug on AddIntoMemoryStream

rnd_j
Wow! That was fast!!!
Thank you again!