This is a library for reading metadata from audio files. It supports the following formats:
- MP3 -
AudioFormat.MP3 - OGG -
AudioFormat.OGG - WAV -
AudioFormat.WAV
Future support is planned for:
- MP4
- FLAC
- AIFF
- WMA
- AAC
AudioMetadata and AudioFormat are the only classes you need to import.
import {AudioMetadata, AudioFormat} from 'audio-metadata';This will return an object with the metadata description.
AudioMetadata.getMetadataDescription(AudioFormat.MP3)If the file is stored locally, the metadata can be read by passing the file path and the format.
Format detection by file extension is not supported.
AudioMetadata.getByPath('test.mp3', AudioFormat.MP3);If the file is stored in memory, the metadata can be read by passing the file buffer and the format.
AudioMetadata.getByBuffer(buffer, AudioFormat.WAV);This library is still in development. It is not recommended to use it in production. Issues and pull requests are welcome.