PDA

View Full Version : How to play a song without any delay in Phonon audio player?



kishoreksnair
19th September 2011, 10:11
sample code:


audioOutput = new Phonon::AudioOutput(Phonon::VideoCategory, this);
volumeSlider = new Phonon::VolumeSlider(ui->frame_2);
volumeSlider->setObjectName(QString::fromUtf8("volumeSlider"));
volumeSlider->setStyleSheet("border:none;background:none;");
volumeSlider->setGeometry(QRect(105,70,141, 50));
mediaObject = new Phonon::MediaObject(this);
mediaObject->setCurrentSource(Phonon::MediaSource(musicpath));
mediaObject->setPrefinishMark(300);
mediaObject->setTransitionTime(0);
connect(mediaObject, SIGNAL(prefinishMarkReached(qint32)), SLOT(nextSource1(qint32)));
Phonon::createPath(mediaObject, audioOutput);
volumeSlider->setAudioOutput(audioOutput);

/////////////////////////////////////////////////////////

void MainWindow::nextSource1(qint32)
{
mediaObject->seek(0);
}


now there is a delay below one second..
we want to play a sound without any delay(gapless playback)
please help me to avoid this problem...I am new in QT ...i am using QT 4.7.4,developing QT GUI application...