QAudioOutput isn't integrated with system volume and libresource like QMediaPlayer
Currently if you create an application that uses QMediaPlayer you get automatic integration with the system volume control and with libresource. Unfortunately this isn't the case if you're using the lower level QAudioOutput mechanism in QtMultimedia, this leads to apps being less well integrated with overall sound system as they have to implement everything themselves.
This is of particular interest for CuteSpotify, as it has to use QAudioOutput to handle the raw audio packets sent from libspotify.
Thanks!
Would it be possible to rewrite it to use QMediaPlayer instead? Looking at the code it seems that all buffering is done in qspotifysession.cpp, correct? If so it should be pretty straightforward and maybe, just maybe, you will find a pull request from me, if such rewrite is interesting.
Mohjive ( 2014-01-03 00:42:37 +0200 )editI could be mistaken, but as far as I'm aware there's no real mechanism for constantly pushing data to a QMediaPlayer element. Instead we'd have to wait for the entire song to buffer and wrap it in a QMediaResource before sending it to a QMediaPlayer, which wouldn't be terribly practical.
Elleo ( 2014-01-03 00:54:02 +0200 )editAnd I would suspect that due to the gstreamer pipeline setup and teardown involved in changing QMediaPlayer sources, sending multiple QMediaResources containing small chunks of a song would result in rather choppy playback (and a fair amount of extra overhead).
Elleo ( 2014-01-03 00:55:58 +0200 )editI'd be very happy if you prove me wrong though ;)
Elleo ( 2014-01-03 00:56:26 +0200 )editDoes this question means we can adjust volume when phone is locked? Like every other phone?
@Elleo, thanks for the Spotify app!
BonoNL ( 2014-01-04 21:21:32 +0200 )edit