SOLVED -- See below.
OK. This boggles!
my @buffer;
# Returns float **
my $prebuff_ptr = vorbis_analysis_buffer($vd, READ);
my @pre_buffer := nativecast(CArray[CArray[num32]], $prebuff_ptr);
# Looks like data!
say "PB: {@pre_buffer[0]} / {@pre_buffer[0][0]}";
# Uninterleave.
# cw: I'm sure there's a smarter way to do this in P6...
loop ($i = 0; $i < $bytes/4; $i++) {
# Same data!
say "PB1: {@pre_buffer[0]} / {@pre_buffer[0][$i]}";
# No data. Weird!
say "PB2: {@pre_buffer[0].WHAT} / {@pre_buffer[0][$i].WHAT}";
# No data! Throws error.
@pre_buffer[0][$i] = 0;
}
And here's the output.
PB: NativeCall::Types::CArray[num32]<-1248000780> / 0
PB1: NativeCall::Types::CArray[num32]<-1248000780> / 0
Use of uninitialized value of type NativeCall::Types::CArray[num32] in string context
Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed. in block at t/04-write-oggvorbis.t line 126
Use of uninitialized value of type Num in string context
Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed. in block at t/04-write-oggvorbis.t line 126
PB2: /
This type cannot unbox to a native number
in block at t/04-write-oggvorbis.t line 128
in block <unit> at t/04-write-oggvorbis.t line 102
Well, when dealing with a NativeCall type on the Left Hand Side (LHS), it is prudent to enforce the type on the RHS.
In my case, this fixed the problem:
@pre_buffer[0][$i] = Num(0);
Thanks to RabidGravy on freenode:#perl6 for the all too simple solution.