Audio-SoundFile
view release on metacpan or search on metacpan
Reader/Reader.xs view on Meta::CPAN
SV **head;
pdl *newp;
size_t blen;
PPCODE:
{
CHECK_AND_INIT(self, hash, file, head);
newp = PDL->create(PDL_PERM);
newp->datatype = PDL_S;
PDL->setdims(newp, (PDL_Long *)&blocks, 1);
PDL->allocdata(newp);
blen = sf_read_short((SNDFILE *)SvIV(*file), newp->data, blocks);
if (blen > 0) {
newp->nvals = blen;
PDL->SetSV_PDL(SvRV(bref), newp);
}
else {
PDL->destroy(newp);
sv_setsv(SvRV(bref), &PL_sv_undef);
( run in 0.635 second using v1.01-cache-2.11-cpan-454fe037f31 )