On Fri, Jan 20, 2017 at 7:36 PM, fredvs <fi...@hotmail.com> wrote: > Re-hello. > > Ok, thanks Silvio, I will take this one from your advice, it works like > charm: > > type > TOggOpusFile = THandle; >
Hm... you should keep the same C data types. :-) I took a look at `OggOpusFile` type, it is a struct: https://github.com/gcp/opusfile/blob/9a9825df0319138fe845cbb19c250b642965c4b1/include/opusfile.h#L133 so on Pascal it makes more sense declared as: type POggOpusFile = ^OggOpusFile; OggOpusFile = record end; and finally: op_read: function(OpusFile: POggOpusFile; ... `PDArFloat` seems OK to `op_read_float`, but notice last comment regarding `_pcm`. "li: pointer" should be "li: pcint" in both funcs. go slowly: these changes can raise new errors on your code. :-) TDArFloat = array of cfloat; > PDArFloat = ^TDArFloat; > > op_read: function(OpusFile: TOggOpusFile; pcm : PDArFloat; SampleCount: > Integer; li: pointer): Integer; > `_pcm` on original code is an `int16` buffer... consider to using `cint16`: https://github.com/gcp/opusfile/blob/9a9825df0319138fe845cbb19c250b642965c4b1/include/opusfile.h#L1873 op_read_float: function(OpusFile: TOggOpusFile; pcm : PDArFloat; > SampleCount: Integer; li: pointer): Integer; > > Many thanks. > > Fre;D -- Silvio Clécio
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal