QSoundEffect(qaudio): Error decoding source

简介: QSoundEffect(qaudio): Error decoding source

其他中添加音频播放的时候出现了

QSoundEffect(qaudio): Error decoding source

主要的流程是:

  1. 1.创建声音
  2. 2.设置文件路径
  3. 3.设置循环模式
  4. 4.设置音量
  5. 5。播出现这种问题,可以尝试使用其他的文件试试,这次是文件损坏了,换了个文件就好了。放

代码如下:

voice=new QSoundEffect(this);
voice->setSource(QUrl::fromLocalFile(":/media/voice/alarm2.wav"));
voice->setLoopCount(QSoundEffect::Infinite);
voice->setVolume(1.0);
voice->play();

出现这种问题,可以尝试使用其他的文件试试,这次是文件损坏了,换了个文件就好了。

相关文章
|
算法 C# C++
HALCON error #1201: Wrong type of control parameter: 1 in operator threshold
HALCON error #1201: Wrong type of control parameter: 1 in operator threshold
|
5月前
|
JSON JavaScript API
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) 错误分析
本文探讨了Python中处理JSON数据时遇到的`JSONDecodeError`,该错误通常由JSON格式错误或数据源问题引起。解决方法包括检查数据源、使用异常处理机制和调试日志记录。示例代码展示了如何从文件和API读取JSON并处理异常。注意事项涉及验证JSON规范、处理特殊字符和选择合适解析器。通过这些步骤,可以有效解决JSON解码错误,确保数据正确解析。
371 0
error C2449: found ‘{‘ at file scope (missing function header?)和error C2059: syntax error : ‘}‘
error C2449: found ‘{‘ at file scope (missing function header?)和error C2059: syntax error : ‘}‘
113 0
|
5月前
Parsing error: No Babel config file detected for XXXXX
Parsing error: No Babel config file detected for XXXXX
|
Linux
Specified sample format -1 is invalid or not supported
Specified sample format -1 is invalid or not supported
209 0
Specified sample format -1 is invalid or not supported
|
前端开发 数据库
Failed to load response dataNo data found for resource with given identifier
Failed to load response dataNo data found for resource with given identifier
1452 0
|
PyTorch 算法框架/工具
THCudaCheck FAIL file=/pytorch/aten/src/THC/THCGeneral.cpp line=405 error=11 : invalid argument
THCudaCheck FAIL file=/pytorch/aten/src/THC/THCGeneral.cpp line=405 error=11 : invalid argument
203 0
THCudaCheck FAIL file=/pytorch/aten/src/THC/THCGeneral.cpp line=405 error=11 : invalid argument
FFmpeg Invalid data found when processing input
FFmpeg Invalid data found when processing input
502 0
|
编解码
configure: error: You requested G729 audio codec but not found...die
configure: error: You requested G729 audio codec but not found...die
81 0
Dx unsupported class file version 52.0 Conversion to Dalvik format failed with error 1
Dx unsupported class file version 52.0 Conversion to Dalvik format failed with error 1
147 0