
Product
PHP and Composer Support Is Now in Beta
Socket’s PHP and Composer support is now in Beta for all customers, with PHP reachability analysis generally available.
@seemusic/audio-metadata
Advanced tools
Extract audio metadata in the browser (ID3 tags via jsmediatags + duration via AudioContext)
从浏览器端音频文件中提取元数据(ID3 标签 + 音频时长),纯浏览器实现,零 Node.js 依赖。
"A / B" → ["A", "B"])npm install @seemusic/audio-metadata
# or
pnpm add @seemusic/audio-metadata
# or
yarn add @seemusic/audio-metadata
import { extractAudioMetadata, splitPeople } from '@seemusic/audio-metadata';
// 上传音频后提取元数据
const file = inputElement.files[0];
const meta = await extractAudioMetadata(file);
console.log(meta.title); // "虫儿飞"
console.log(meta.artists); // ["郑少秋"]
console.log(meta.composers); // ["陈光荣"]
console.log(meta.cover); // "data:image/jpeg;base64,..."
console.log(meta.duration); // 198
console.log(meta.isFallback); // false(非 MP3 格式时为 true)
// 拆分艺人字符串
const names = splitPeople('周杰伦 / 林俊杰');
// => ["周杰伦", "林俊杰"]
extractAudioMetadata(file, options?)| 参数 | 类型 | 说明 |
|---|---|---|
file | File | 音频文件 |
options.skipCover | boolean | 是否跳过封面解析(大文件时节省内存) |
返回 Promise<ExtractedMetadata>,结构:
interface ExtractedMetadata {
title?: string;
artists: string[];
album?: string;
composers: string[];
lyricists: string[];
genres: string[];
lyrics?: string;
isrc?: string;
cover?: string; // data:image/jpeg;base64,...
duration?: number; // 秒
isFallback?: boolean; // 非 MP3 格式时为 true
}
splitPeople(value)| 参数 | 类型 | 说明 |
|---|---|---|
value | string | undefined | 艺人字符串,如 "A / B, C" |
返回 string[],自动按 / , ; , ; 拆分。
AudioContext.decodeAudioDataMIT
FAQs
Extract audio metadata in the browser (ID3 tags via jsmediatags + duration via AudioContext)
The npm package @seemusic/audio-metadata receives a total of 10 weekly downloads. As such, @seemusic/audio-metadata popularity was classified as not popular.
We found that @seemusic/audio-metadata demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.

Product
Socket’s PHP and Composer support is now in Beta for all customers, with PHP reachability analysis generally available.

Product
Socket is bringing experimental protection to Firefox, scanning 97,000+ extensions in Mozilla's official directory for malware and risky updates.

Research
/Security News
Three compromised Rust crates pulled in a malicious dependency that downloaded and executed cross-platform malware during Cargo builds.