Skip to content

Add array-based acoustic APIs: predict_arrays() and encode_arrays() #52

Description

@fegue

Summary

Follow up on #47 by adding array-based acoustic APIs to birdnetR.

The file-based encoding API was added in #47, but the array-based APIs were intentionally deferred to keep scope narrow.

Motivation

The underlying Python birdnet package exposes both:

  • predict_arrays()
  • encode_arrays()

In birdnetR, array-based support should be added as a coherent pair rather than exposing only one of them. This keeps the acoustic API symmetric across input modalities:

  • file input: predict(), encode()
  • array input: predict_arrays(), encode_arrays()

Proposed scope

  • add predict_arrays() for birdnet_model_acoustic
  • add encode_arrays() for birdnet_model_acoustic
  • define and document the R input contract for in-memory audio arrays and sample rates
  • add tests for R-to-Python conversion and result handling
  • update documentation and pkgdown reference

Notes

Potential design questions to resolve:

  • preferred R input structure for audio arrays plus sample rate
  • validation rules for array shape and type
  • whether helper utilities are needed for user-friendly construction of array inputs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions