Question

I'm using Qt with phonon to play some mp3 files. The problem is that I need multiple mp3 files running together and they are not playing in a synchronized fashion, especially when I order to seek or something.

I've noticed that from the hard drive synchronization is better than from an USB drive. It seems that the program doesn't load the whole file into memory. Since I need to put this program on a USB drive, is there any way to allocate a file into memory and then play from that?

Was it helpful?

Solution

If your concern is reading from the filesystem, maybe you can just cache your sound files into QBuffer objects ahead of time, and then use them in the Phonon::MediaSource(QIODevice * ioDevice)

That way you are no longer depending on the filesystem to maintain stable IO. Its in memory like you wanted.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top