We created an application using Phonon MediaObject.In this application we want
to play a song continuously without any delay.After surfing from various web resources :we use Qsound method.Its completely rectified the looping problem just we use setLoop(-1).But we could't find several phonon functionality in QSound such as:Volumeslider,pause,seekslidebar etc.

Qt Code:
  1. QString extmusicpath="sound/sample.wav";
  2. Phonon::SeekSlider *extSeekSlider;
  3. Phonon::MediaObject *extMediaObject;
  4. Phonon::MediaObject *extMetaInformationResolver;
  5. Phonon::AudioOutput *extAudioOutput;
  6. Phonon::VolumeSlider *extVolumeSlider;
  7.  
  8.  
  9. extAudioOutput= new Phonon::AudioOutput(Phonon::VideoCategory, this);
  10. extVolumeSlider = new Phonon::VolumeSlider(ui->externalDirFrame);
  11. extVolumeSlider->setObjectName(QString::fromUtf8("volumeSlider"));
  12. extVolumeSlider->setStyleSheet("border:none;background:none;");
  13. extVolumeSlider->setGeometry(QRect(100,40,150,50));
  14. extMediaObject= new Phonon::MediaObject(this);
  15. extMediaObject->setCurrentSource(Phonon::MediaSource(extmusicpath));
  16. extMediaObject->setPrefinishMark(300);
  17. extMediaObject->setTransitionTime(0);
  18. connect(extMediaObject,SIGNAL(prefinishMarkReached(qint32)), SLOT(extnextSource(qint32)));
  19. Phonon::createPath(extMediaObject,extAudioOutput);
  20. extVolumeSlider->setAudioOutput(extAudioOutput);
  21.  
  22. void MainWindow::extnextSource(qint32)
  23. {
  24. extMediaObject->seek(0);
  25. }
To copy to clipboard, switch view to plain text mode 


After using the above methods,there is less than one second delay while looping

How can we rectify this problem?