Releases: phpmlkit/soundfile
Releases · phpmlkit/soundfile
v1.1.0
What's Changed
sf_read()now returns[NDArray, SfInfo]instead of[NDArray, int].- Added
SfMetadataclass andsf_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
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 optionalstart/stoprange,always2dflag, and chunked internal I/Osf_write()— write NDArrays to 25+ audio formats with automatic dtype-to-subtype conversionsf_info()— probe file metadata (frames, channels, sample rate, format, subtype, seekable) without loading datasf_check_format()— validate container/encoding format compatibility
Streaming I/O
SoundFileclass — instance-based handle with read, write, seek, tell, block iteration, and metadata tagsblocks()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