All Projects → Borewit → Music Metadata Browser

Borewit / Music Metadata Browser

Licence: mit
Browser version of music-metadata parser Supporting a wide range of audio and tag formats.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Music Metadata Browser

Music Metadata
Stream and file based music metadata parser for node. Supporting a wide range of audio and tag formats.
Stars: ✭ 455 (+333.33%)
Mutual labels:  tag, wav, metadata, audio, mp3, flac, tags
Atldotnet
Fully managed, portable and easy-to-use C# library to read and edit audio data and metadata (tags) from various audio formats, playlists and CUE sheets
Stars: ✭ 180 (+71.43%)
Mutual labels:  wav, metadata, audio, mp3, flac, tags
audio-tag-analyzer
Extracts metadata music metadata found in audio files
Stars: ✭ 18 (-82.86%)
Mutual labels:  metadata, tags, mp3, flac, tag
Mediafile
A unified reader of metadata from audio & video files.
Stars: ✭ 138 (+31.43%)
Mutual labels:  wav, audio, mp3, flac
Libnyquist
🎤 Cross platform C++11 library for decoding audio (mp3, wav, ogg, opus, flac, etc)
Stars: ✭ 311 (+196.19%)
Mutual labels:  wav, audio, mp3, flac
Miniaudio
Single file audio playback and capture library written in C.
Stars: ✭ 1,889 (+1699.05%)
Mutual labels:  wav, audio, mp3, flac
Audio Steganography Algorithms
A Library of Audio Steganography & Watermarking Algorithms
Stars: ✭ 146 (+39.05%)
Mutual labels:  wav, audio, mp3, flac
Ni Media
NI Media is a C++ library for reading and writing audio streams.
Stars: ✭ 158 (+50.48%)
Mutual labels:  wav, audio, mp3, flac
Symphonia
Pure Rust multimedia format demuxing, tag reading, and audio decoding library
Stars: ✭ 191 (+81.9%)
Mutual labels:  wav, audio, mp3, flac
Flacon
Audio File Encoder. Extracts audio tracks from an audio CD image to separate tracks.
Stars: ✭ 252 (+140%)
Mutual labels:  wav, audio, mp3, flac
Audioplayer
Audio Player for Nextcloud and ownCloud
Stars: ✭ 179 (+70.48%)
Mutual labels:  wav, audio, mp3, flac
audio-metadata
A library for reading and, in the future, writing audio metadata. https://audio-metadata.readthedocs.io/
Stars: ✭ 41 (-60.95%)
Mutual labels:  metadata, mp3, wav, flac
Av Converter
[av-converter.com] Audio and Video Converter, and YouTube downloader. Convert to MP3, MP4, AAC, FLAC, AC3, WAV, etc.
Stars: ✭ 97 (-7.62%)
Mutual labels:  wav, audio, mp3, flac
flutter audio desktop
[WIP] An 🎵 audio playback library for Flutter Desktop. Supports Windows & Linux. Based on miniaudio.
Stars: ✭ 42 (-60%)
Mutual labels:  mp3, wav, flac
Soloud
Free, easy, portable audio engine for games
Stars: ✭ 1,048 (+898.1%)
Mutual labels:  audio, mp3, flac
Javascript Media Recorder
WebRTC video recorder library for Javascript
Stars: ✭ 61 (-41.9%)
Mutual labels:  wav, audio, mp3
Id3
Library to read, modify and write ID3 & Lyrics3 tags in MP3 files. Provides an extensible framework for retrieving ID3 information from online services.
Stars: ✭ 27 (-74.29%)
Mutual labels:  tags, mp3, tag
Recorder
html5 js 浏览器 web端录音
Stars: ✭ 429 (+308.57%)
Mutual labels:  wav, audio, mp3
Redoflacs
Parallel BASH commandline FLAC compressor, verifier, organizer, analyzer, and retagger
Stars: ✭ 71 (-32.38%)
Mutual labels:  audio, flac, tags
java-stream-player
🌌Java Advanced Audio Controller Library (WAV, AU, AIFF, MP3, OGG VORBIS, FLAC, MONKEY's AUDIO and SPEEX audio formats )
Stars: ✭ 112 (+6.67%)
Mutual labels:  mp3, wav, flac

Karma CI NPM version npm downloads Known Vulnerabilities Total alerts Language grade: JavaScript Codacy Badge Coverage Status Minified size Chat

music-metadata-browser

music-metadata-browser is a metadata parser, supporting virtual any audio format and tag header around.

music-metadata-browser is a node module, designed for modern browser applications. Because modules don't run directly in the browser you need a module bundler, like Webpack or Parcel. The module bundler turns the modules (dependencies), together with you application code, into a static asset (typically a minified JavaScript file). The output of module bundler is compatible and optimized for execution by a web browser.

Integration with React or Angular should not be a problem:

If you prefer to parse files or streams server (node.js) side, you should use music-metadata instead.

Features

Support for audio file types

Audio format Description Wiki
AIFF / AIFF-C Audio Interchange File Format 🔗 Apple rainbow logo
AAC ADTS / Advanced Audio Coding 🔗 AAC logo
APE Monkey's Audio 🔗 Monkey's Audio logo
ASF Advanced Systems Format 🔗
DSDIFF Philips DSDIFF 🔗 DSD logo
DSF Sony's DSD Stream File 🔗 DSD logo
FLAC Free Lossless Audio Codec 🔗 FLAC logo
MP2 MPEG-1 Audio Layer II 🔗
Matroska Matroska (EBML), mka, mkv 🔗 Matroska logo
MP3 MPEG-1 / MPEG-2 Audio Layer III 🔗 MP3 logo
MPC Musepack SV7 🔗 musepack logo
MPEG 4 mp4, m4a, m4v 🔗 mpeg 4 logo
Ogg Open container format 🔗 Ogg logo
Opus 🔗 Opus logo
Speex 🔗 Speex logo
Theora 🔗 Theora logo
Vorbis Vorbis audio compression 🔗 Vorbis logo
WAV RIFF WAVE 🔗
WebM webm 🔗 Matroska logo
WV WavPack 🔗 WavPack logo
WMA Windows Media Audio 🔗 Windows Media logo

Support for tags

Support for MusicBrainz tags as written by Picard.

Audio format & encoding details

Support for encoding / format details:

Online demo's

Sponsor

Become a sponsor to Borewit

Usage

Installation

Install via npm:

npm install music-metadata-browser

or using yarn:

yarn add music-metadata-browser

Import music-metadata

Import music-metadata in JavaScript

const musicMetadata = require('music-metadata-browser');

This is how it's done in TypeScript

import * as musicMetadata from 'music-metadata-browser';

Module Functions

There are currently three ways to parse (read) audio tracks:

  1. parsing a Web API blob or file with the parseBlob function.
  2. Using ReadableStream using the parseReadableStream function.
  3. Using Node.js streams using the parseNodeStream function.
  4. Provide a URL to fetch the audio track from.

parseBlob function

Parse an audio file from a Blob or File.

const musicMetadata = require('music-metadata-browser');

let blob;

musicMetadata.parseBlob(blob).then(metadata => {
    // metadata has all the metadata found in the blob or file
  });

Or with async/await if you prefer:

(async () => {
  let blob;

  const metadata = await musicMetadata.parseBlob(blob);
  // metadata has all the metadata found in the blob or file
});

parseReadableStream function

import * as mm from 'music-metadata-browser';

mm.parseReadableStream(readableStream)
  .then(metadata => {
     console.log(util.inspect(metadata, { showHidden: false, depth: null }));
     readableStream.close();
   });

Parse from a Web API ReadableStream.

If available, pass the mime-type and file-size. Without the mime-type, the content will be audio type will be automatically detected.

It is recommended to provide the corresponding MIME-type. An extension (e.g.: .mp3), filename or path will also work. If the MIME-type or filename is not provided, or not understood, music-metadata will try to derive the type from the content.

import * as mm from 'music-metadata-browser';

const readableStream = result.node;

mm.parseReadableStream(readableStream, {size: 21032, mimeType: 'audio/mpeg'})
  .then( metadata => {
     console.log(util.inspect(metadata, { showHidden: false, depth: null }));
     someReadStream.cancel();
   });

parseNodeStream function

import * as mm from 'music-metadata-browser';

mm.parseNodeStream(readableStream)
  .then( metadata => {
     console.log(util.inspect(metadata, { showHidden: false, depth: null }));
     readableStream.destroy();
   });

The readable stream is derived from Node's readable stream.

If available, pass the mime-type and file-size. Without the mime-type, the content will be audio type will be automatically detected.

import * as mm from 'music-metadata-browser';

(async () => {
  const metadata = await mm.parseNodeStream(someReadStream, {mimeType: 'audio/mpeg', size: 26838 });
  console.log(util.inspect(metadata, { showHidden: false, depth: null }));
  someReadStream.close();
});

fetchUrl function

If you wish to stream your audio track over HTTP you need can use fetchFromUrl which is using the Fetch API to retrieve the audio track:

import * as mm from 'music-metadata-browser';

(async () => {
  const metadata = await mm.fetchFromUrl(audioTrackUrl, options);
});

orderTags function

Utility to Converts the native tags to a dictionary index on the tag identifier

orderTags(nativeTags: ITag[]): [tagId: string]: any[]

ratingToStars function

Can be used to convert the normalized rating value to the 0..5 stars, where 0 an undefined rating, 1 the star the lowest rating and 5 the highest rating.

ratingToStars(rating)

rating is a number between 0.0 and 1.0

Returns the number of stars: 0, 1, 2, 3, 4 or 5.

selectCover function

Select cover image based on image type field, otherwise the first picture in file.

export function selectCover(pictures?: IPicture[]): IPicture | null
import * as mm from 'music-metadata';

(async () => {
  const {common} = await mm.parseFile(filePath);
  const cover = mm.selectCover(common.picture); // pick the cover image
}
)();

Options

  • duration: default: false, if set to true, it will parse the whole media file if required to determine the duration.
  • fileSize: only provide this in combination with parseStream function.
  • observer: (update: MetadataEvent) => void;: Will be called after each change to common (generic) tag, or format properties.
  • skipCovers: default: false, if set to true, it will not return embedded cover-art (images).
  • skipPostHeaders? boolean default: false, if set to true, it will not search all the entire track for additional headers. Only recommenced to use in combination with streams.
  • includeChapters default: false, if set to true, it will parse chapters (currently only MP4 files). experimental functionality

Although in most cases duration is included, in some cases it requires music-metadata parsing the entire file. To enforce parsing the entire file if needed you should set duration to true.

Metadata result

If the returned promise resolves, the metadata (TypeScript IAudioMetadata interface) contains:

  • format: IFormat Audio format information
  • native: INativeTags List of native (original) tags found in the parsed audio file.
  • common: ICommonTagsResult Is a generic (abstract) way of reading metadata information.

Format

Audio format information. Defined in the TypeScript IFormat interface:

  • container?: string Audio encoding format. e.g.: 'flac'
  • codec? Name of the codec (algorithm used for the audio compression)
  • codecProfile?: string Codec profile / settings
  • tagTypes?: TagType[] List of tagging formats found in parsed audio file
  • duration?: number Duration in seconds
  • bitrate?: number Number bits per second of encoded audio file
  • sampleRate?: number Sampling rate in Samples per second (S/s)
  • bitsPerSample?: number Audio bit depth
  • lossless?: boolean True if lossless, false for lossy encoding
  • numberOfChannels?: number Number of audio channels
  • numberOfSamples?: number Number of samples frames, one sample contains all channels. The duration is: numberOfSamples / sampleRate

Common

Common tag documentation is automatically generated.

Automated testing

Automated unit tests are planned to be tested with different browsers. This service has been kindly made available by browserstack.com.

Unfortunately these tests are frequently failing due to technical difficulties.

Licence

(The MIT License)

Copyright (c) 2017 Borewit

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].