And this one ?
op_read: function(OpusFile: TOggOpusFile; pcm : pcint; SampleCount: Integer;
li: pcint): Integer;
op_read_float: function(OpusFile: TOggOpusFile; pcm : pcfloat; SampleCount:
Integer; li: pcint): Integer;
op_read_stereo: function(OpusFile: TOggOpusFile; pcm : pcint; SampleCount:
Inte
On Sat, Jan 21, 2017 at 11:11 AM, fredvs wrote:
> Hello everybody.
>
> Do you agree with this ? :
>
> type
> TOggOpusFile = ^OggOpusFile;
> OggOpusFile = record
> end;
>
> op_read: function(OpusFile: TOggOpusFile; pcm : pcfloat; SampleCount:
> Integer; li: pointer): Integer;
>
It's almost
Hello everybody.
Do you agree with this ? :
type
TOggOpusFile = ^OggOpusFile;
OggOpusFile = record
end;
op_read: function(OpusFile: TOggOpusFile; pcm : pcfloat; SampleCount:
Integer; li: pointer): Integer;
op_read_float: function(OpusFile: TOggOpusFile; pcm : pcfloat; SampleCount:
Integer;
ascal] Array as result in function.
If the C code however is the one allocating the array (in which case the
type is usually a pointer to a pointer, like "float**" or "^pcfloat" in
Pascal) then you *must not* use a Pascal array, but instead simply pass
in a "pcfloat&q
@ Silvio
> Try two tests:
>$ echo -e '#include \nint main(){printf("size of float: %zu\\n",
sizeof(float));return 0;}'
> fredvs.c && gcc -o fredvs fredvs.c && clear && ./fredvs # it prints "size
> of float: 4" on your terminal
==> size of float: 4
> $ echo "program fredvs;begin writeln('sizeof
On 20.01.2017 23:36, fredvs wrote:
> Re-hello.
>
> Ok, thanks Silvio, I will take this one from your advice, it works like
> charm:
>
> type
> TOggOpusFile = THandle;
> TDArFloat = array of cfloat;
> PDArFloat = ^TDArFloat;
>
> op_read: function(OpusFile: TOggOpusFile; pcm : PDArFloat; Sam
On Fri, Jan 20, 2017 at 9:06 PM, silvioprog wrote:
[...]
> `_pcm` on original code is an `int16` buffer... consider to using `cint16`:
>
Damn Gmail's Ctrl+Enter. -.-'
I meant: "`_pcm` on original code is an `int16` buffer... consider to using
`*pcint16*`:"
--
Silvio Clécio
___
On Fri, Jan 20, 2017 at 7:36 PM, fredvs 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://gi
On Fri, Jan 20, 2017 at 7:11 PM, fredvs wrote:
> Hello Silvio.
>
> Wow, thanks, I will study it deep.
>
> By the way, the Opus Pascal wrappers are working.
> You may listen, seek, saving to file, apply dsp,.. to Opus files.
> You may try SimplePlayer demo in uos (all libraries and Opus-audiofile
Re-hello.
Ok, thanks Silvio, I will take this one from your advice, it works like
charm:
type
TOggOpusFile = THandle;
TDArFloat = array of cfloat;
PDArFloat = ^TDArFloat;
op_read: function(OpusFile: TOggOpusFile; pcm : PDArFloat; SampleCount:
Integer; li: pointer): Integer;
op_read_float:
Hello Silvio.
Wow, thanks, I will study it deep.
By the way, the Opus Pascal wrappers are working.
You may listen, seek, saving to file, apply dsp,.. to Opus files.
You may try SimplePlayer demo in uos (all libraries and Opus-audiofile
included):
https://github.com/fredvs/uos
PS: BufferIn is wo
On Fri, Jan 20, 2017 at 5:14 PM, silvioprog wrote:
[...]
>
> It seems that function just increment the address of a (float) buffer, so:
>
I meant "It seems that function just fill a (float) buffer". ^^'
--
Silvio Clécio
___
fpc-pascal maillist - fpc
On Fri, Jan 20, 2017 at 3:45 PM, fredvs wrote:
>
> Here, for example from OpusFile.h =>
>
> OP_WARN_UNUSED_RESULT int op_read_float(OggOpusFile *_of,
> float *_pcm,int _buf_size,int *_li) OP_ARG_NONNULL(1);
>
> Translated in fpc with:
>
> op_read: function(OpusFile: TOggOpusFile; var pcm; SampleC
Here, for example from OpusFile.h =>
OP_WARN_UNUSED_RESULT int op_read_float(OggOpusFile *_of,
float *_pcm,int _buf_size,int *_li) OP_ARG_NONNULL(1);
Translated in fpc with:
op_read: function(OpusFile: TOggOpusFile; var pcm; SampleCount: Integer; li:
pointer): Integer;
And used like this:
Bu
On Fri, Jan 20, 2017 at 1:12 PM, fredvs wrote:
[...]
Please look at Sven's warn regarding Pascal arrays mixed with C arrays.
Could you show us the original C function?
--
Silvio Clécio
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http:
Hello.
Hum,...
I am guilty. ;-(
There was a SetLength(Bufferin, x) hidden.
So the length of bufferin into the function was not the same as the "pure"
one.
So, to resume:
If using:
function arraycopy(arrayin : Tarrayfloat): Tarrayfloat;
begin
result := arrayin;
end;
==> Perfect, the inp
Hello.
Some more investigations.
Let say we have a array of float of length = 100 (arrayin):
setlength(arrayin,100);
A external library fill this array with 80 samples (ouframes).
When using that arrayin pure (without any dsp) the sound is pure too.
If using:
function arraycopy(arrayin : Tar
Am 20.01.2017 13:18 schrieb "fredvs" :
>
> Thanks very much for answers.
>
> @ silvioprog:
>
> > using that function as callback with some (C/C++) library?
>
> Yes and check its parameter calling convention is ok.
You shouldn't use Pascal arrays when interfacing with C/C++ code as
especially dyna
Thanks very much for answers.
@ silvioprog:
> using that function as callback with some (C/C++) library?
Yes and check its parameter calling convention is ok.
@ Martin.
> result:= copy(arrayin);
Ha, I did not know this one.
I will try it (and write you asap).
Many thanks.
Fre;D
-
Am 2017-01-20 um 07:52 schrieb Martin Schreiber:
> On Thursday 19 January 2017 22:50:36 fredvs wrote:
>> function array_in_out(arrayin: TArFloat): TArFloat;
>> begin
>> result := arrayin;
>> end;
> Do you change items of "arrayin" later? If so the items of the result array
> will be changed too, d
On Thursday 19 January 2017 22:50:36 fredvs wrote:
> function array_in_out(arrayin: TArFloat): TArFloat;
> begin
> result := arrayin;
> end;
>
Do you change items of "arrayin" later? If so the items of the result array
will be changed too, dynamic array assignment copies the data pointer only.
ht
On Thu, Jan 19, 2017 at 6:50 PM, fredvs wrote:
> Hello.
>
> With this code, the result of the function does not have same format as the
> array input:
>
> Why ?
>
> type
> TArFloat = array of cfloat;
>
> function array_in_out(arrayin: TArFloat): TArFloat;
> begin
> result := arrayin;
> end;
>
Hello.
With this code, the result of the function does not have same format as the
array input:
Why ?
type
TArFloat = array of cfloat;
function array_in_out(arrayin: TArFloat): TArFloat;
begin
result := arrayin;
end;
Some more explaination.
If in a code I use:
var
thebuffer: TArFloat;
/
23 matches
Mail list logo