诺基亚 E63 手机 CPU 瓶颈

发布于 2024-10-02 15:47:27 字数 571 浏览 0 评论 0原文

我正在使用 Qt SDK 为 Nokia E63 创建一个应用程序。我可以通过实现继承 QIODevice 的类来实现录音功能。每次手机硬件读取新的音频样本时,它都会将它们转发到我的 QIODevice 进行写入。

我的目标录制频率是16000 Hz,但设备仅支持8000 Hz和48000 Hz。我选择以 48000 Hz 进行录制,然后将其重新采样到 16000 Hz。此方法记录正常,除非10秒左右手机死机!我认为原因是我的 QIODevice 中的写入函数无法跟上新样本的生成速度 (48000 hz)。 write 方法跟不上的原因是它有重新采样的额外开销。

在单独的线程中实现重新采样并将样本写入文件功能是否有帮助?

在记录 QIODevice 的写入函数中,我只需将样本复制到缓冲区,然后让我的重新采样线程绕过缓冲区重新采样并写入文件。这个方法行得通吗?

I am creating an application for the Nokia E63 using the Qt SDK. I can implement audio recording functionality by implementing a class that inherits QIODevice. Every time the phone hardware reads in new audio samples it forwards them to my QIODevice for writing.

My target recording frequency is 16000 Hz, but the device only supports 8000 Hz and 48000 Hz. I chose to record at 48000 and then re-sample it to 16000 Hz. This method records fine except after 10 seconds or so the phone crashes! I assume the reason for this is that the write function in my QIODevice can't keep up with the speed at which new samples are produced (48000 hz). The reason the write method can't keep up is because it has the additional overhead of re-sampling.

Would implementing the re-sampling and writing the samples to a file functions in a separate thread help?

In the write function of the recording QIODevice, I just copy the sample to a buffer and then have my re-sampling thread go around the buffer re-sampling and writing to file. Will this method work?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

新雨望断虹 2024-10-09 15:47:27

对诺基亚开发不太了解,但我假设诺基亚 Qt SDK 会有某种手机模拟器。我想说首先在模拟器上测试一下,以确保您的代码没有问题。它可能只是代码中的错误,甚至可能是 Qt 中的错误。也可以在不同的手机上尝试一下,看看问题是否与硬件有关。

Don't know much about Nokia development, but I assume that Nokia Qt SDK will have an phone Emulator of some sort. I'd say test it out first on the emulator to make sure its not a problem with your code. It could just be a bug within your code or maybe even a bug within Qt. Also try it out on a different phone to see if the issue is hardware related.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文