SFML Audio not Working - c++

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.

Related

How to install Qt to work with OpenCV and Visual Studio 2022

I am sorry if this question is already asked but, from every source I have read on google so far they don't cover the most latest versions and I am having a lot of trouble figuring this out.
I have a VS code for detecting faces and saving the ROI onto the desktop. Now, I need to add the functionality for force capture and need to employ GUI for it which openCV is not good enough for. I have been told to use Qt. For more than a week now I have been stuck at simply installing Qt and getting it to work. If anyone could help me out in-line with my project's purpose I would greatly appreciate it.
Every time I install I get some sort of different error which I am not able to understand (complete beginner here), the latest one I got was that Qt could not find the "Kit", even though the dialog box displayed the available ones (Mingw 2022).
Thanks in advance!

MySql connector-c++ wont link in QtCreator but works fine locally on raspberry pi3

Firstly, thank you in advance for at least reading this question.
Secondly, feel free to call me an idiot if this is a "no brainer"
Now down to the issue at hand...
I am running Ubuntu 16.04 (64bit) with QT Creator as my IDE and on the whole it works great. I can cross compile for the Raspberry Pi3 (running raspbian) and also compile plugins for X-Plane.
Everything was going great until I needed to implement MySql into my project. That's when it all went south.
I can not use the Qt library for this as X-Plane does not like anything Qt related in its plugins. But that is fine, I have connector-c++ working on that machine and it connects to my MySql server and does everything it's supposed to.
I think I have read just about every forum and watched every youtube video on this but can not get Qt Creator to compile with connector for the raspberry pi.
I wrote/compiled a test app locally (with g++) on the pi and it works great. However for some reason (government plot maybe?) it refuses to link the libraries when compiling under Qt Creator.
The error I get when compiling in QtCreator is:
undefined reference to `get_driver_instance'
Currently,
I have followed the instructions for setting up a cross compiler here:
https://wiki.qt.io/RaspberryPi2EGLFS
Downloaded the connector code from here:
git clone https://github.com/mysql/mysql-connector-cpp
I have followed the instructions for compiling connector-c++ here:
https://dev.mysql.com/doc/connector-cpp/en/connector-cpp-installation-source-unix.html
And I have banged my head 1000x on a brick wall here:
(picture of blood stained wall not available)
Also, I have tried compiling connector on my Ubuntu pc with paths to the pi's sysroot etc. but i think it made a 64bit version which causes Qt Creator to have a dummy spit about "unrecognized format".
I am hoping that this is just me having a "senior moment" and that someone can point me in the right direction.
To save putting up irrelevant logs/code I will wait until someone asks for it and then copy/paste what they need.
Again, thanks in advance and know that I will be eternally grateful for any light on this matter (preferably before I go even insanerer)
Well after 2 weeks of pain, I have solved this problem. Here is what I think is the issue:
Firstly, I found that mysqlcppconn is not needed (at least for me) and used the mysql libraries in /usr/lib
Secondly, the symlinks to libmysqlclient.so.6.0.22 were by default:
libmysqlclient.so.6 -> libmysqlclient.so.6.0.22
The compiler was looking for libmysqlclient.so which didn't exist. So I created the link (libmysqlclient.so -> libmysqlclient.so.6) and it worked!!
Thanks to all who helped.

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.

CodeBlocks 13.12 adding sound

Hello I just started learning c++, and my teacher wants us to create a game for our final exam.
I am using CodeBlocks 13.12 and can't seem to be able to add any game sound. I just need to play a simple .wav file if you guys could show me how that would look I'd greatly appreciate it.
The teacher made adding sound extra credit because he didn't actually show us how to do that. I have no clue as to how to do it so please show if I have to change anything in the settings.
I haven't worked much with audio files either, but a quick search turned up the following links:
StackOverflow: Playing a wav file
CodeProject: Audio files in c++
It looks that (for Windows at least) you can use
PlaySound
Check out the Windows documentation for PlaySound and make sure to include windows.h!
#include <windows.h>
Note: I should expand on AdamS's comment. CodeBlocks is your Integrated Development Environment (IDE). Your question is specific to the language C++ but not to the IDE CodeBlocks. If your code is correct but you still can't hear the sounds, then it could be an issue with your IDE or your computer.

OpenCV - How do I get started?

I just don't seem to be able to get OpenCV to work properly. Here's what I want to accomplish:
Use CodeBlocks (which I installed using codeblocks-10.05mingw-setup.exe) with OpenCV (installer: OpenCV-2.4.2.exe) on my Windows x64.
I've tried a lot of different configurations which will only bother you if I posted them all, so I hope you don't mind if I just ask the simple question: how do I get this to work?
I think I'm missing the smallest detail right now, so a detailed description of how to get started would be welcome.
If the OpenCV installer did the job, you should have by now OpenCV libraries and headers already installed in your system.
I would then go ahead and try to compile a hello world basic code, like the one you can get from here. If you would like to program using an IDE, like VisualC++ in Windows, you can follow this guide that will help you setting up the environment.
OpenCV team just introduced their new web site. There you can find Introduction to OpenCV section with installation instructions, including detailed instructions for Windows. Don't forget to cleanup your system before installation to avoid problems with mixing different install options. If you still can't get it working with CodeBlocks, follow Dan's advice and try compiling from command line.
When you are done with installation, go on and read there great new tutorials!