Zat*_*ion 13 node.js node-modules
我想实现以下目标:
所有这些操作都可以基于本机Node.js(没有浏览器).是否有任何模块提供这样的功能或我可以开发基于?
msp*_*ars 12
对于那些通过Google提出这个问题的人来说,有一个节点模块可以做到这一点,包括读写元数据:https: //www.npmjs.org/package/ffmetadata
我不知道是否有办法在 NodeJS 中实际进行元数据操作。这是一种解决方法,但您可以使用child_process.execperl 来完成此操作:
var exec = require('child_process').exec,
child;
child = exec('perl changeTags.pl file.mp3',
function (error, stdout, stderr) {
console.log('stdout: ' + stdout);
console.log('stderr: ' + stderr);
if (error !== null) {
console.log('exec error: ' + error);
}
});
Run Code Online (Sandbox Code Playgroud)
#!/usr/bin/perl
use MP3::Tag;
$mp3 = MP3::Tag->new(@ARGV[0]); # create object
$mp3->get_tags(); # read tags
print "Attempting to print tags for @ARGV[0]\n";
if (exists $mp3->{ID3v2}) {
print "Comments: " . $mp3->{ID3v2}->comment . "\n";
print "Zip: " . $mp3->{ID3v2}->album . "\n";
print "Tags: " . $mp3->{ID3v2}->title . "\n";
} else {
print "@ARGV[0] does not have ID3v2 tags\n";
}
$mp3->close(); # destroy object
Run Code Online (Sandbox Code Playgroud)
类似的事情。您显然想要为您实际想要将元数据更改为的内容提供更多参数......祝您好运!
| 归档时间: |
|
| 查看次数: |
6489 次 |
| 最近记录: |