AAC input

This commit is contained in:
Marco 2020-10-28 15:42:33 +01:00 committed by Thulinma
parent 12246581e6
commit e961d71c16
5 changed files with 363 additions and 0 deletions

View file

@ -133,6 +133,18 @@ namespace aac{
return res.str();
}
// Returns Init info used to init DTSC audio track
std::string adts::getInit() const{
std::string init;
init.resize(2);
init[0] = ((getAACProfile() & 0x1F) << 3) |
((getFrequencyIndex() & 0x0E) >> 1);
init[1] = ((getFrequencyIndex() & 0x01) << 7) |
((getChannelConfig() & 0x0F) << 3);
return init;
}
adts::operator bool() const{
return hasSync() && len && len >= getHeaderSize() && getFrequency() && getChannelCount() &&
getSampleCount();

View file

@ -24,6 +24,7 @@ namespace aac{
bool hasSync() const;
char *getPayload();
std::string toPrettyString() const;
std::string getInit() const;
operator bool() const;
private: