Nokia E63 phone CPU bottleneck
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 reco开发者_运维问答rding 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?
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.
精彩评论