简体   繁体   English

诺基亚E63手机CPU瓶颈

[英]Nokia E63 phone CPU bottleneck

I am creating an application for the Nokia E63 using the Qt SDK. 我正在使用Qt SDK为诺基亚E63创建一个应用程序。 I can implement audio recording functionality by implementing a class that inherits QIODevice . 我可以通过实现继承QIODevice的类来实现音频录制功能。 Every time the phone hardware reads in new audio samples it forwards them to my QIODevice for writing. 每次手机硬件读入新的音频样本时,它都会将它们转发给我的QIODevice进行写入。

My target recording frequency is 16000 Hz, but the device only supports 8000 Hz and 48000 Hz. 我的目标录制频率为16000 Hz,但设备仅支持8000 Hz和48000 Hz。 I chose to record at 48000 and then re-sample it to 16000 Hz. 我选择以48000记录,然后重新采样到16000赫兹。 This method records fine except after 10 seconds or so the phone crashes! 这种方法记录很好,除了10秒左右手机崩溃! 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). 我认为这是因为我的QIODevice中的写入功能无法跟上新样本的生成速度(48000赫兹)。 The reason the write method can't keep up is because it has the additional overhead of re-sampling. write方法无法跟上的原因是它具有重新采样的额外开销。

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. 在记录QIODevice的写入功能中,我只是将样本复制到缓冲区,然后让我的重新采样线程绕过缓冲区重新采样并写入文件。 Will this method work? 这种方法有用吗?

Don't know much about Nokia development, but I assume that Nokia Qt SDK will have an phone Emulator of some sort. 不太了解诺基亚的开发,但我认为诺基亚Qt SDK将拥有某种类型的手机模拟器。 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. 它可能只是您代码中的错误,甚至可能是Qt中的错误。 Also try it out on a different phone to see if the issue is hardware related. 也可以在另一部手机上试一试,看看问题是否与硬件有关。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM