×

Discussion Board

Results 1 to 3 of 3
  1. #1
    archerabi
    Guest

    Phonon::Mediasource and QBuffer

    Hello ,
    So i am trying to use a QBuffer as a mediasource for Phonon::mediaObject.
    Code:
       QFile file("c:\\data\\images\\123.mp3");
        file.open(QIODevice::ReadOnly);
    
        QByteArray array =file.read(512*1024);
        QBuffer* buffer = new QBuffer(&array);
        buffer->open(QIODevice::ReadOnly);
    
        mediaObject->setCurrentSource( Phonon::MediaSource(buffer));
        mediaObject->play();
    But at mediaObject->setCurrentSource there is an error that says media type could not be determined.
    Does anyone have a suggestion as to why this is happening.
    if i replace the source with ( QString file) , it starts playing fine.

    Are there code samples using Qbuffer as source?

    thanks.

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Phonon::Mediasource and QBuffer

    Never mind

  3. #3
    Super Contributor
    Join Date
    Jul 2008
    Posts
    2,020

    Re: Phonon::Mediasource and QBuffer

    AFAIK, the Phonon can only use files on the file system, and not files stored in a buffer or in a resource.

    This limitation exists on most platforms...
    The lines above are the best I have to offer.If anyone of you is of more advanced knowledge, I ask for your patience and understanding! - unknown arab poet
    http://www.tamoggemon.com - Symbian blog - Windows Phone blog
    My other blogs:
    webOS blog iPhone blog BlackBerry blog Samsung bada blog Android blog

Similar Threads

  1. phonon problem
    By pta0007 in forum Nokia N9
    Replies: 5
    Last Post: 2010-03-25, 11:39
  2. Phonon on Ubuntu
    By borut_dagarin in forum [Archived] Qt SDKs and Tools
    Replies: 0
    Last Post: 2010-01-28, 17:38
  3. Qt/Phonon
    By ravite036 in forum Nokia N9
    Replies: 1
    Last Post: 2009-11-02, 14:41

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •