Made some audio info fields now mandatory, otherwise consider parsing failed

This commit is contained in:
emeric
2025-11-03 08:48:25 +01:00
parent b25e3b9b1e
commit 9611cc09e3
10 changed files with 61 additions and 70 deletions
+5 -11
View File
@@ -39,19 +39,13 @@ namespace lms::audio
std::ostream& operator<<(std::ostream& os, const AudioProperties& audioProperties)
{
os << "\tDuration: " << std::fixed << std::setprecision(2) << std::chrono::duration_cast<std::chrono::duration<float>>(audioProperties.duration) << std::endl;
if (audioProperties.container)
os << "\tContainer: " << containerTypeToString(*audioProperties.container) << std::endl;
if (audioProperties.codec)
os << "\tCodec: " << codecTypeToString(*audioProperties.codec) << std::endl;
if (audioProperties.bitrate)
os << "\tBitrate: " << *audioProperties.bitrate << " bps" << std::endl;
os << "\tContainer: " << containerTypeToString(audioProperties.container) << std::endl;
os << "\tCodec: " << codecTypeToString(audioProperties.codec) << std::endl;
os << "\tBitrate: " << audioProperties.bitrate << " bps" << std::endl;
if (audioProperties.bitsPerSample)
os << "\tBitsPerSample: " << *audioProperties.bitsPerSample << std::endl;
if (audioProperties.channelCount)
os << "\tChannelCount: " << *audioProperties.channelCount << std::endl;
if (audioProperties.sampleRate)
os << "\tSampleRate: " << *audioProperties.sampleRate << std::endl;
os << "\tChannelCount: " << audioProperties.channelCount << std::endl;
os << "\tSampleRate: " << audioProperties.sampleRate << std::endl;
return os;
}