mirror of
https://github.com/codedread/bitjs
synced 2025-10-04 10:09:16 +02:00
Add support for AAC-LC codec
This commit is contained in:
parent
73cfa291f6
commit
744162ec5b
3 changed files with 77 additions and 3 deletions
|
@ -40,6 +40,13 @@ describe('codecs test suite', () => {
|
|||
})).to.throw();
|
||||
});
|
||||
|
||||
it('detects MP3', () => {
|
||||
expect(getShortMIMEString({
|
||||
format: { format_name: 'mp3' },
|
||||
streams: [ { codec_type: 'audio'}, { codec_type: 'video' } ],
|
||||
})).equals('audio/mpeg');
|
||||
});
|
||||
|
||||
it('detects AVI video', () => {
|
||||
expect(getShortMIMEString({
|
||||
format: { format_name: 'avi' },
|
||||
|
@ -252,4 +259,32 @@ describe('codecs test suite', () => {
|
|||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('AAC', () => {
|
||||
/** @type {ProbeInfo} */
|
||||
let info;
|
||||
|
||||
beforeEach(() => {
|
||||
info = {
|
||||
format: { format_name: 'mov,mp4,m4a,3gp,3g2,mj2' },
|
||||
streams: [{
|
||||
codec_type: 'audio',
|
||||
codec_tag_string: 'mp4a',
|
||||
}],
|
||||
};
|
||||
});
|
||||
|
||||
it('throws when unknown', () => {
|
||||
expect(() => getFullMIMEString(info)).to.throw();
|
||||
});
|
||||
|
||||
describe('Profile tests', () => {
|
||||
it('recognizes AAC-LC', () => {
|
||||
info.streams[0].profile = 'LC';
|
||||
expect(getFullMIMEString(info))
|
||||
.to.be.a('string')
|
||||
.and.equals('audio/mp4; codecs="mp4a.40.2"');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue