Skip to content

Releases: phpmlkit/soundfile

v1.1.0

29 May 07:13
91d9e54

Choose a tag to compare

What's Changed

  • sf_read() now returns [NDArray, SfInfo] instead of [NDArray, int].
  • Added SfMetadata class and sf_metadata() for one-off reading of embedded tags
  • Clarify terminology for signal properties vs embedded tags
  • Make a platform package

Full Changelog: 1.0.0...1.1.0

v1.0.0

29 May 04:15
7c4d40d

Choose a tag to compare

Initial release

Low-level audio I/O and resampling for PHP, backed by libsndfile and libsamplerate.

Reading and writing

  • sf_read() — read audio files into NDArrays with optional start/stop range, always2d flag, and chunked internal I/O
  • sf_write() — write NDArrays to 25+ audio formats with automatic dtype-to-subtype conversion
  • sf_info() — probe file metadata (frames, channels, sample rate, format, subtype, seekable) without loading data
  • sf_check_format() — validate container/encoding format compatibility

Streaming I/O

  • SoundFile class — instance-based handle with read, write, seek, tell, block iteration, and metadata tags
  • blocks() generator — iterate over large files in fixed-size chunks without loading everything into memory
  • Read, Write, and ReadWrite modes with API-level mode guards

Sample rate conversion

  • sf_resample() — convert between sample rates with four quality levels
  • Chunked progressive mode (default) for safe memory usage on large signals
  • One-shot simple mode for small signals

Metadata

  • Read and write title, artist, album, track number, genre, and 10+ other artbitrary tags on open handles

Credits

  • libsndfile and libsamplerate — the C libraries powering all audio I/O and resampling
  • phpmlkit/ndarray — the NDArray data structure used for audio data
  • Static links: Ogg, Vorbis, FLAC, Opus, mpg123, and LAME