[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-multimedia
Subject: Re: How play part of a sound file?
From: Matthias Kretz <kretz () kde ! org>
Date: 2007-10-05 11:39:02
Message-ID: 200710051339.06600.kretz () kde ! org
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
Hi,
first you should go to api.kde.org instead of developer.kde.org. The
documentation you were looking at was "Generated on Fri Oct 6 00:29:29 2006"
Regarding your question: the current API is not meant for any exact timings
(which is also impossible with xine at least). But if close to 3000ms/8000ms
is good enough for you you can do the following:
m_media = new MediaObject;
AudioOutput *out = new AudioOutput(Phonon::MusicCategory, m_media);
Phonon::createPath(m_media, out);
m_media->setCurrentSource(...);
m_media->pause();
m_media->seek(3000);
m_media->play();
m_media->setTickInterval(100);
connect(m_media, SIGNAL(tick(qint64)), SLOT(tick(qint64)));
.
.
.
void tick(qint64 position)
{
if (position > 7900) {
m_media->stop();
}
}
On Friday 05 October 2007, Erik wrote:
> I need to play a part of a sound file, for example from 3000 ms to 8000
> ms. I looked at the documentation at
> [http://developer.kde.org/documentation/library/cvs-api/kdelibs-apidocs/pho
>non/html/classPhonon_1_1AudioPlayer.html] without finding what I was looking
> for. There is "void seek (qint64 ms)", so I suppose I could call
> "seek(3000); play()" but that does not tell it to stop at 8000 ms.
--
________________________________________________________
Matthias Kretz (Germany) <><
http://Vir.homelinux.org/
MatthiasKretz@gmx.net, kretz@kde.org,
Matthias.Kretz@urz.uni-heidelberg.de
["signature.asc" (application/pgp-signature)]
_______________________________________________
kde-multimedia mailing list
kde-multimedia@kde.org
https://mail.kde.org/mailman/listinfo/kde-multimedia
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic