Reply
Thread Tools
mikec's Avatar
Posts: 1,366 | Thanked: 1,185 times | Joined on Jan 2006
#1
Have been playing with Qt Phonon and there are some problems. Would appreciate any help here.

I'm trying to play a loop of audio witch is 150ms in length over and over again. The idea was to set up a queue of samples, and keep adding to the queue every time we got a signal from the prefinishmark. but there seems to be a big gap still between samples playing.
__________________
N900_Email_Options Wiki Page
 
hopbeat's Avatar
Posts: 516 | Thanked: 643 times | Joined on Oct 2009 @ Denmark/Poland
#2
@mikec, what you can try to do is to have MediaObject with signals connected like finished->play or maybe to of those Objects and use aboutToFinish to prepare second object to play.

[edit] although is there any particular reason you need to use phonon instead of gstreamer for this task?
__________________
Hi! I'm a Maemo Greeter!
Witaj na talk.maemo.org!

Useful links for newcomers:
Użyteczne linki:
Nowi użyktownicy mówią cześć | New members say hello , Tu zaczynają nowi użytkownicy | New users start here, Podforum społeczności | Community subforum, Wiki dla początkujących | Beginners' wiki page, Maemo5 101, Często zadawane pytania | Frequently Asked Questions (FAQ), Google

Jeżeli mogę w czymś pomóc, pytaj!
If I can help with anything else, just ask!

Bored? Follow me

Last edited by hopbeat; 2010-04-23 at 16:50.
 
mikec's Avatar
Posts: 1,366 | Thanked: 1,185 times | Joined on Jan 2006
#3
Originally Posted by hopbeat View Post
@mikec, what you can try to do is to have MediaObject with signals connected like finished->play or maybe to of those Objects and use aboutToFinish to prepare second object to play.

[edit] although is there any particular reason you need to use phonon instead of gstreamer for this task?
only that I'm trying to use Qt only. but if gstreamer can do this better I would welcome a small snippet of code to play this sample. I'm using PyQT

EDIT

Hopbeat hear is my curent code as you have itemised above, and I get beep beep instead of beeeeeep

Code:
        self.m_media1 = Phonon.MediaObject(self)
        audioOutput = Phonon.AudioOutput(Phonon.MusicCategory, self)
        Phonon.createPath(self.m_media1, audioOutput)
        self.m_media1.setCurrentSource(Phonon.MediaSource("stylo_smpl/c#4v.wav"))
        self.connect(self.m_media1, SIGNAL("aboutToFinish()"), self.enqueFile)
        self.m_media1.setPrefinishMark(0)
        self.m_media1.setTransitionTime(0)




    def enqueFile(self):
           self.m_media1.enqueue(Phonon.MediaSource("stylo_smpl/c#4v.wav"))
__________________
N900_Email_Options Wiki Page

Last edited by mikec; 2010-04-23 at 17:08.
 
Posts: 3,319 | Thanked: 5,610 times | Joined on Aug 2008 @ Finland
#4
I’m not sure if this works in the experimental packages you have, but I would try going QtMultimedia rather than phonon... Check this out:

http://www.riverbankcomputing.co.uk/...diooutput.html

EDIT: scratch that, I see that I did not build QtMultimedia for PR1.1, it will be there for PR1.2, though (not much of a consolation, I know).
__________________
Blogging about mobile linux - The Penguin Moves!
Maintainer of PyQt (see introduction and docs), AppWatch, QuickBrownFox, etc

Last edited by attila77; 2010-04-23 at 17:25.
 
mikec's Avatar
Posts: 1,366 | Thanked: 1,185 times | Joined on Jan 2006
#5
hmm, I thought you needed Qt4.7 for that stuff?
just tried to import like this

from PyQt4.QtMultimedia import *

and says no module QtMultimedia
__________________
N900_Email_Options Wiki Page
 
Posts: 3,319 | Thanked: 5,610 times | Joined on Aug 2008 @ Finland
#6
Nope, it’s Qt4.6 all right, it’s just that I did not add it to the package list in the PR1.1 build and I have upgraded my packages and SDK afterwards so that whatever I make comes now out as PR1.2... Sorry for the distraction. I can offer a 5-10% size reduction and similar speedup in load times for PyQt under PR1.2, though
__________________
Blogging about mobile linux - The Penguin Moves!
Maintainer of PyQt (see introduction and docs), AppWatch, QuickBrownFox, etc
 

The Following 2 Users Say Thank You to attila77 For This Useful Post:
Posts: 3,319 | Thanked: 5,610 times | Joined on Aug 2008 @ Finland
#7
Originally Posted by hopbeat View Post
[edit] although is there any particular reason you need to use phonon instead of gstreamer for this task?
Gstreamer in Qt just looks... wrong. I hope they make a proper wrapping for it at some point. Anyhow, here’s an example of PyQt + GStreamer:

http://www.mail-archive.com/pyqt@riv.../msg18696.html
__________________
Blogging about mobile linux - The Penguin Moves!
Maintainer of PyQt (see introduction and docs), AppWatch, QuickBrownFox, etc
 
jflatt's Avatar
Posts: 534 | Thanked: 723 times | Joined on Oct 2009
#8
prefinishMark set to 0 disables it, and 0 is the default, so that line would be unnecessary. Maybe that has some unintended side-effect?
 
Posts: 291 | Thanked: 59 times | Joined on Mar 2010 @ Manchester, UK
#9
wow, seems like a lot of coding for the stylophone app

thanks again!!!
 
mikec's Avatar
Posts: 1,366 | Thanked: 1,185 times | Joined on Jan 2006
#10
Originally Posted by jflatt View Post
prefinishMark set to 0 disables it, and 0 is the default, so that line would be unnecessary. Maybe that has some unintended side-effect?
ok cheers, removed that and its the same. I do have bleeding edge PyQT so maybe some side effect
__________________
N900_Email_Options Wiki Page
 
Reply


 
Forum Jump


All times are GMT. The time now is 13:28.