Skip to content

Changelog

All notable changes to phpmlkit/sndfile will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

v1.0.0 - 2026-05-29

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

Released under the MIT License.