kopia lustrzana https://gitlab.com/eliggett/wfview
Fix if 0 samples detected
rodzic
7098564121
commit
3e0c008144
|
@ -84,7 +84,7 @@ bool audioConverter::convert(audioPacket audio)
|
|||
{
|
||||
|
||||
// If inFormat and outFormat are identical, just emit the data back.
|
||||
if (audio.data.size() != 0 && inFormat != outFormat)
|
||||
if (audio.data.size() > 0 && inFormat != outFormat)
|
||||
{
|
||||
|
||||
if (inFormat.codec() == "audio/opus")
|
||||
|
@ -154,14 +154,13 @@ bool audioConverter::convert(audioPacket audio)
|
|||
qInfo(logAudio()) << "Unsupported Sample Type:" << inFormat.sampleType() << "Size:" << inFormat.sampleSize();
|
||||
}
|
||||
|
||||
if (samplesF.size() > 0)
|
||||
|
||||
{
|
||||
audio.amplitude = samplesF.array().abs().maxCoeff();
|
||||
// Set the volume
|
||||
samplesF *= audio.volume;
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
samplesF is now an Eigen Vector of the current samples in float format
|
||||
The next step is to convert to the correct number of channels in outFormat.channelCount()
|
||||
|
@ -301,6 +300,7 @@ bool audioConverter::convert(audioPacket audio)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
emit converted(audio);
|
||||
return true;
|
||||
|
|
Ładowanie…
Reference in New Issue