PDA

View Full Version : looping problem in phonon audio player



vinayaka
19th July 2011, 05:41
song is set as static in phonon audio player. loop works using aboutToFinish().the problem is that there is 1 sec delay at the end of the song, the the song repeats.
how can we avoid the delay?


musicpath="sound/sample.mp3";
Phonon::AudioOutput *audioOutput;
Phonon::VolumeSlider *volumeSlider;

Phonon::MediaObject *mediaObject;
mediaObject = new Phonon::MediaObject(this);
mediaObject->setCurrentSource(Phonon::MediaSource( musicpath));
Phonon::createPath(mediaObject, audioOutput);
volumeSlider->setAudioOutput(audioOutput);
mediaObject->setCurrentSource(Phonon::MediaSource( musicpath));

mediaObject->play();
ui->play->hide();
ui->pause->show();
connect(mediaObject, SIGNAL(aboutToFinish()), this, SLOT(aboutToFinish1()));


void MainWindow::aboutToFinish1()

{

mediaObject->stop();
mediaObject->play();
}

lucky
12th August 2011, 09:36
song is set as static in phonon audio player. loop works using aboutToFinish().the problem is that there is 1 sec delay at the end of the song, the the song repeats.
how can we avoid the delay?


musicpath="sound/sample.mp3";
Phonon::AudioOutput *audioOutput;
Phonon::VolumeSlider *volumeSlider;

Phonon::MediaObject *mediaObject;
mediaObject = new Phonon::MediaObject(this);
mediaObject->setCurrentSource(Phonon::MediaSource( musicpath));
Phonon::createPath(mediaObject, audioOutput);
volumeSlider->setAudioOutput(audioOutput);
mediaObject->setCurrentSource(Phonon::MediaSource( musicpath));

mediaObject->play();
ui->play->hide();
ui->pause->show();
connect(mediaObject, SIGNAL(aboutToFinish()), this, SLOT(aboutToFinish1()));


void MainWindow::aboutToFinish1()

{

mediaObject->stop();
mediaObject->play();
}


hello, you test this ?

why i cannot run it !~

nix
12th August 2011, 10:04
Have you check the transitionTime property?
I use enqueue ( const MediaSource & source ) when aboutToFinish() appears and it works fine (no latency at all). Your method with stop & start seems not working for me (the song is not played at the second time). However I'm not on a Windows computer, maybe it can explain those differents observations.