View Single Post
Posts: 986 | Thanked: 1,526 times | Joined on Jul 2010
#17
heres a (crappy, work-in-progress) cmdline audio-file player that i use as the backend to my music thingie (klomp). it requires pyqt which is installable using zypper if you ignore the error about breaking it.

unfortunately, there is a bug in QT that makes the QMediaPlayer fail on vbr MP3s, so i had to write an extremely lowlevel player using QAudioDecoder for mp3.

also no keyboard control yet, just a few cmdline args

https://github.com/teleshoes/klomp/b...rc/qtcmdplayer

Code:
usage: qtcmdplayer [-h] [--loop] [--volume VOLUME] [--mp3] [--nomp3]
                   FILE [POSITION_MILLIS] [COMMAND_FIFO]

Play music/sound files from the command line using PyQt5 media tools.

positional arguments:
  FILE                  sound file to play
  POSITION_MILLIS       optional starting position in millis
  COMMAND_FIFO          optional path to existing FIFO for listening to
                        commands

optional arguments:
  -h, --help            show this help message and exit
  --loop, -loop         when playback is finished, play again immediately
                        forever
  --volume VOLUME, -volume VOLUME
                        set volume 0 - 100(values greater than 100 are allowed
                        only for MP3s, or with --mp3)
  --mp3                 force MP3 mode regardless of file extension (use
                        QAudioDecoder+QAudioOutput instead of QMediaPlayer)
  --nomp3               force non-MP3 mode regardless of file extension (use
                        QMediaPlayer instead of QAudioDecoder+QAudioOutput)
__________________
~ teleshoes ~
 

The Following 5 Users Say Thank You to wolke For This Useful Post: