Wxpython mp3 player on raspberry pi - python-2.7

I found this mp3 player for wxpython http://www.blog.pythonlibrary.org/2010/04/20/wxpython-creating-a-simple-mp3-player/
It works fine on windows, but now I want to play the music on my raspberry pi.
But it gives an error that it can't play the music files. So what's wrong? Do I have to install another mediaplayer on the raspberry pi?

It would help matters if you posted what the error was.
However, I suspect that loading libwxgtk-media2.8-0 and any dependencies would probably help.
Notes:
There is also libwxgtk-media3.0-0 for later versions of wxpython
I believe that on Linux/Rpi it uses gstreamer0.10 which is, arguably, now defunct.

Related

Audio with QML - Unable to play a wav file

3 days I'm stuck with a tricky issue!
I've built an image for my embedded device based on a Colibri T20 board, using Yocto.
I"ve added Qt5, using X11 (because Tegra20 drivers from nvidia support hw accel only with X11...).
At this point, everything works fine.
I've also generated the respective SDK to build application for the respective platform..
Works fine.
I wrote a simple application to play audio file, very basic...just to play wav files...
It does not work. No sound output.
import QtMultimedia 5.5
Item {
...
Audio {
id: audioPlayer
source: "file:///opt/track.wav"
}
..
onClick() {
idPlayer.play()
}
}
This code works fine on my host linux.
But not on my Colibri.
Qt 5.5.1 was firstly built with ALSA, pulseaudio (gstreamer plugins...).
No outpût.
But in the linux, I can play the wav file using:
aplay /opt/track.wav
So I assume that my alsa driver are up-to-date.
Then, I 've recompiled Qt 5.5.1 without pulseaudio....
It does not work better :(
To be honnest, I'm not very experienced with alsa and pulseaudio matter. I'm very fustrated bzecause I don't understand what's happening under the abstracted layer of QtMultuimedia.
Any suggestion is welcome...This issue is simply driving me mad ;)

Qt: no playback on linux

I have tried (I think) every possible way of playing audio in a Qt project, none of which have worked:
QSound::play(...)
QMediaPlayer
QAudioOutput, from http://doc.qt.io/qt-4.8/qaudiooutput.html
None of these solutions play WAV or MP3, and I have tried loading the files from a resource (qrc:media/file.wav) or simply from disk (/full/path/to/file.wav).
I think the problem is with codecs. QAudioDevice::supportedCodecs() returns an empty list. I'm on a linux system that has no problems playing audio/video (Ubuntu 14.04, usually playing in VLC... that uses its own codecs?).
Playing with QSound (WAV & MP3):
QSoundEffect(pulseaudio): Error decoding source
QMediaplayer (WAV): nothing happens
QMediaplayer (MP3):
GStreamer; Unable to play - "qrc:media/lowtone.mp3"
Qt uses specific media backends for each platform(link is qt5, but it was the same in Qt4). From the error it looks like your version is using GStreamer.
Check if the gstreamer dev packages on your distribution are well installed, because QAudioDevice::supportedCodecs must return at least audio/pcm. Work on the package setup until your test program show pcm. See https://wiki.qt.io/Building_Qt_for_Linux
You may also need to install plugins (also dev packages) before being able to play wav or mp3 using phonon.

GStreamer encountered a general stream error in Qt5 raspberry pi

I'm trying to play a video using QtMediaPlayer in Raspberry pi 2 B. The source code is as follows:
QMediaPlayer *media;
QVideoWidget *video;
...
...
media = new QMediaPlayer(parent);
video = new QVideoWidget(parent);
media->setVideoOutput(video);
media->setMedia(QUrl::fromLocalFile("/home/pi/Desktop/test3.mp4"));
media->play();
But the result is a blank video screen and the following error:
** (Bus:2148): WARNING **: ffmpegcolorspace-vo: size 1105920 is not a
multiple of unit size 829440
Error: "GStreamer encountered a general stream error."
System Information
Running latest raspbian Jessie OS,
Installed Qt5.3,
Installed gstreamer0.10-plugins-good/bad/ugly/ffmpeg and
Installed Mpeg-2 License
Here is the video test3.mp4
I ran this code in Windows with Qt5 installed; it is working there. But it's not working in the Raspberry pi. Please tell me what I'm missing here.
Trying Pipe from Shell
Video playback on the Raspberry Pi is actually a bit of a tricky thing. The most common solution is to use OMXPlayer to play videos. It's a command line program, but there are lots of flags and repeated calls can control playback. All in all, it works pretty dang well for most smallish projects.
As far as actually using Qt, QMediaPlayer, and etc. I don't think you'll be able to make it work right out of the box. However, I found a blog that discusses this issue and has some Raspberry Pi firmware that fixes QtMultimedia support on the Raspberry Pi.

Using Qt Media Player on Raspberry Pi 1

I have a project built using Qt5 which has to play a video. Just like in the videowidget sample code.
I've followed these instructions to build qt5 on my Pi. And it went just fine. But when I try to run any qt program that uses QMediaPlayer, I get the error message:
defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer"
Which means I don't have a backend to play the video, right? Is there any one that I can use which will with Qt, like ffmpeg? And how can I get it to work? Specially for h264 videos.
I've tried to install gstreamer as is told on this link, but it's not working. Will I have to rebuild the entire qt5 again?
P.S.: I have the raspberry pi 1 model B with raspbian installed.
Edit: As mentioned by Greenflow, I checked the ./configure log and saw that the GStreamer was compiled in, but the video apps are still not working...
The message on the log was like this:
GStreamer .............. yes (0.10)
And the message on Greenflow's log was like this:
GStreamer .............. yes (1.0)
Clearly it's another version of GStreamer, but is it the problem?
I've also found this post which says QtMultimedia on the Pi is rather useless, but the post is from 2013, so I'm not sure if it's really relevant. I'd like to have this app playing hardware accelerated videos on my Raspberry Pi, but I'm almost dropping the idea.
Anyways, thanks Greenflow for the head start.
Edit 2: Found this thread on the Qtcentre. Damn, this thing is not going to be easy to solve, I guess...
sudo apt-get install libqt5multimedia-plugins solved this for me.

SFML Audio not Working

I was using SFML earlier and I decided to play around with the audio settings. I made an instance of sf::Music and tried to play a sound. However I got an error that came up saying
"The program can't start because openal32.dll is missing from your computer. Try reinstalling the program to fix this problem." I am making this as a project for the Ludum Dare so if this is a common problem I don't really want to have to use this. First off, where do I get openal32.dll? Is this a common problem? And what is an alternative that I can use in c++ for playing audio? Thanks!
OpenAL is an audio API that SFML is using internally. You have to make users install the OpenAL dlls, but the official site appears to be offline. You can try googling for a working link to download the OpenAL package.
You can use OpenAL-Soft instead:
http://kcat.strangesoft.net/openal.html
It also supports HRTF for binaural headphones. You can also package it with your application (LGPL). You might have to rename soft_oal.dll to OpenAL.dll.