Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to change audio output device in qmediaplayer
Forum Updated to NodeBB v4.3 + New Features

How to change audio output device in qmediaplayer

Scheduled Pinned Locked Moved Mobile and Embedded
3 Posts 2 Posters 7.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    smue_mi
    wrote on last edited by
    #1

    Hi,

    is there an easy way to set the audio output device when I use the QMediaPlayer class in QtMultimediaKit?
    I mean something comparable to the handling of input devices in QMediaRecorder like this:
    @
    audiosource = new QAudioCaptureSource;
    capture = new QMediaRecorder(audiosource);
    audiosource->setAudioInput("my_soundcard");
    @
    where "my_soundcard" is the name of the device I wish to use.

    I need this for cross platform desktop applications on machines with more than one sound card.
    Till now I used phonon and know the way to do this. But to switch to QtMultimediaKit there should be a similar easy way.

    BTW the QtMultimediaKit module looks very promising for me. Thanks so far!

    1 Reply Last reply
    0
    • B Offline
      B Offline
      blex
      wrote on last edited by
      #2

      Short answer: seems that it is no simple way to do this.

      Long answer: QMediaPlayer::play() calls QMediaPlayerControl::play().

      QMediaPlayerControl object is created in QMediaPlayer constructor
      (changed for better reading):

      @QMediaServiceProvider provider;
      QMediaService * service = provider->requestService(Q_MEDIASERVICE_MEDIAPLAYER);
      QMediaPlayerControl
      control = qobject_cast<QMediaPlayerControl*>
      (service->requestControl(QMediaPlayerControl_iid));
      @

      No other assignments to the "control" variable in the QMediaPlayer code, so, control binds to the output on initialization.

      It is result of brief searching the code, maybe I am missed something.


      Oleksiy Balabay

      1 Reply Last reply
      0
      • S Offline
        S Offline
        smue_mi
        wrote on last edited by
        #3

        Ok,

        as far as I can see, the QAudioEndpointSelector class is used for this and the plugins (directshow, gstreamer, symbian) have to inherit this class and implement the features for the underlying audio system. But unfortunately only in symbian and directshow (see ../qt-mobility-opensource-src-1.1.0/plugins/multimedia/...) exists the classes S60MediaPlayerAudioEndpointSelector and respectively DirectShowAudioEndpointControl but not for gstreamer. So the question is now (are there the some of the writers here?): will it be implemented for gstreamer so I can use this under linux and when?

        kind regards!

        1 Reply Last reply
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved