使用cat加入mp3文件.这是什么黑巫术? [英] Using cat to join mp3 files. What is this black sorcery?

查看:78
本文介绍了使用cat加入mp3文件.这是什么黑巫术?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的一个朋友刚刚使用了普通的cat来连接两个mp3文件,...

A friend of mine just used plain-old cat to concatenate two mp3 files,...

cat file1.mp3 file2.mp3 > out.mp3

...并且生成的文件可以完美再现,播放一首歌曲,然后播放下一首歌曲.

...and the resulting file is perfectly reproducible, playing one song and then the next.

这是什么黑魔法?标头,元数据发生了什么?这怎么工作?持续时间甚至可以正确显示.

What is this black magic? What happened to headers, metadata? How can this work? The duration is even displayed correctly.

推荐答案

MP3文件无非就是原始的MPEG2-Layer 3(音频)流数据,没有文件级标头结构,例如持续时间,原始来源,编码信息. MP3流由以同步标记FF Fx开头的块组成,因此可以将任意数据(例如ID3标签)放置在任何位置,并且不会影响音频.如果ID3标签未列出此信息,则玩家可以从比特率和文件大小中猜测持续时间,或者对文件进行全面扫描以准确地计算出它.

An MP3 file is nothing more than the raw MPEG2-Layer 3 (audio) stream data, there is no file level header structure with, for example, duration, original source, encoding info. An MP3 stream is made of blocks starting with a synchronization marker FF Fx, so arbitrary data, such as ID3 tags, can be placed anywhere and will not affect the audio. Players either guess duration from the bitrate and file size if ID3 tags don't list this information or do a full scan of the file to accurately calculate it.

这篇关于使用cat加入mp3文件.这是什么黑巫术?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆