fix: voice playback coordinate bug + debug logging + device name encoding
- messagedelegate: editorEvent now adjusts me->pos() by option.rect.topLeft() - voiceplayback: enhanced debug logging for file open/decode/play - messagelist: debug voice file path + exists check - inputbar: debug mediaDir path on record - sound_manager: debug in playRawPcm, decodeDeviceName() for mixed encodings - voiceencoder: debug file write path
This commit is contained in:
1 parent
324d285145
commit
01012675d0
6 files changed
+45
-9
No files matched your search
@@ -13,10 +13,15 @@ static const uint32_t OPUS_MAGIC = 0x5355504F;
|
||||
int VoicePlayer::decodeOpusFile(const QString& filePath, std::vector<int16_t>& outPcm,
|
||||
int& outSampleRate, int& outChannels, float& outDurationSec) {
|
||||
QFile file(filePath);
|
||||
if (!file.open(QIODevice::ReadOnly)) {
|
||||
qWarning("VoicePlayer: cannot open %s", qPrintable(filePath));
|
||||
if (!file.exists()) {
|
||||
qWarning("VoicePlayer: file not found: %s", qPrintable(filePath));
|
||||
return -1;
|
||||
}
|
||||
if (!file.open(QIODevice::ReadOnly)) {
|
||||
qWarning("VoicePlayer: cannot open %s (%s)", qPrintable(filePath), qPrintable(file.errorString()));
|
||||
return -1;
|
||||
}
|
||||
qDebug("VoicePlayer: opened file %s size=%lld", qPrintable(filePath), (long long)file.size());
|
||||
|
||||
uint32_t magic, sr32;
|
||||
uint16_t ch16, frameSamples;
|
||||
@@ -68,11 +73,17 @@ int VoicePlayer::decodeOpusFile(const QString& filePath, std::vector<int16_t>& o
|
||||
}
|
||||
|
||||
void VoicePlayer::playOpusFile(const QString& filePath) {
|
||||
qDebug("VoicePlayer::playOpusFile: %s", qPrintable(filePath));
|
||||
std::vector<int16_t> pcm;
|
||||
int sampleRate, channels;
|
||||
float duration;
|
||||
|
||||
if (decodeOpusFile(filePath, pcm, sampleRate, channels, duration) <= 0) return;
|
||||
if (decodeOpusFile(filePath, pcm, sampleRate, channels, duration) <= 0) {
|
||||
qWarning("VoicePlayer::playOpusFile: decode failed for %s", qPrintable(filePath));
|
||||
return;
|
||||
}
|
||||
|
||||
qDebug("VoicePlayer::playOpusFile: decoded %zu samples %dHz %dch %.1fs → playing",
|
||||
pcm.size(), sampleRate, channels, duration);
|
||||
SoundManager::instance()->playRawPcm(pcm.data(), pcm.size() / channels, sampleRate, channels);
|
||||
}
|
||||
Reference in new issue
Block a user