playing a runtime generated sine wave with Qt 6.4.2 - audio

I need to play a runtime generated sine wave with Qt 6.4.2
I found many examples, based upon Qt 5, but it seems that in the latest Qt versions, classes like QMediaPlayer and QSoundEffect can only play from files.
Is there a way to play sound from a QByteArray or QBuffer with Qt 6.4.2?
In the examples I've found, QAudioOutput::start(QBuffer* input) is used, but I cannot find it in Qt 6.4.2

Related

Cross-platform way to play audio files (mp3, wav, etc... ) on Python 3?

I'm searching for a library (preferably cross-platform) that lets me play various audio files on Python 3 (currently using 3.3.0).
I have tried several options such as Pyglet but it doesn't run on Py3 (I tried the alpha, which SHOULD have Py3 support).
Is there any library ported to Python 3 yet?
Thanks.
You can use PyQt4 with Python 3. Qt provides powerful cross-platform multimedia framework.
http://www.riverbankcomputing.co.uk/software/pyqt/intro
Here is playing a sound with QtMultimedia example written for python 2, but it is not difficult to adopt it to python 3. Only be sure, that pyqt4-python3 or similar is installed on your system.
Here is a QAudioOutput class, which solves your problem.

python3 audio signal processing

A project I am working on for one of my classes is to build a simple GUI sound editor for kids using python3 (using python3 is a strict project requirement). I don't want this editor to be as complex as something like audacity but I would like to have some fun built in effects similar to the sound editor on the nintendo ds http://nintendo.wikia.com/wiki/Nintendo_DSi_Sound.
I have been researching modules that are compatible with python3 that will help with the audio signal processing since I am very inexperienced in this area but I am running into trouble finding something that will work with python3. I found this great list of music modules for python: http://wiki.python.org/moin/PythonInMusic but everything that seems to have the functionality I think I want such as pyo and snack, does not have python3 compatibility.
I think at this point my best option is to use NumPy and SciPy for the signal processing but I was wondering if anyone had any better suggestions or advice? Or is using NumPy and SciPy an ideal choice if I can become familiar with them?
NumPy/SciPy can process audio signals, but it doesn't feel "native" as you have to write lots of interface code to play the resulting data as sound or write the in some standard format (like .wav).
I'd suggest porting those modules ; it's often very easy and straightforward and a good Python exercis.

What is the minimal set of essential libraries for Face Detection in OpenCV

While trying to use OpenCV for face detection on Windows, I need to pull in almost all the libraries (2d, 3d, ml, gui etc.). Otherwise my program wouldn't run. I am not really sure why I need any GUI for something as algorithmic as object detection. What is the minimal set of libraries required and is there a special way to build OpenCV such that there aren't that many dependencies?
You need opencv_core to get base objects like cv::Mat, opencv_imgproc to use thresholds, histograms and other image pre-processing, and opencv_highgui for reading, writing and displaying images, and using video streams from cameras and video files. That's all I can tell you without knowing how to run openCV on Windows, and not knowing which version of openCV You are using. As far as I know there is no way of building only some parts of openCV.
Generally from my experience You only need to add libraries associated to headers which You are using. So, if you have problems with tracking them try to avoid using #include "opencv2/opencv.hpp" and try a bit harder way of #include "opencv2/core/core.hpp" etc.
Yes, you can build OpenCV without certain library features. OpenCV uses CMake, which requires a little learning if you don't know it already, but you can uncheck OpenCV components you don't need in the CMake build configuration.
You can get away without using highgui in your app if you can read images with some other library (but not sure if you can build OpenCV without it).
Also - you will need to #include "opencv2/objdetect/objdetect.hpp" for support of Haar cascade classifiers (as of OpenCV 2.3.1).

MIDI decoder library

I want to know a free C/C++ library that can load and decode MIDI files.
I will play it with alsa or DirectSound,
Juce is a C++ framework that has a MidiFile class.
PortMIDI is another framework with a class for reading SMF (SMF is an acronym for Standard MIDI File).

Capturing audio input from microphone, with Haskell?

Is there a mature library that could enable audio input and output and work within Haskell? (A nice wrapper is fine, of course.)
I'm looking for something that can easily capture microphone input and, perhaps, play various audio files as well.
easily capture microphone input and, perhaps, play various audio files as well..
It will strongly depend on your OS platform: there are standard C libraries for this functionality on each OS, and you'll be looking for Haskell bindings to them (e.g. PulseAudio, etc). Look in the Sound category on Hackage:
http://hackage.haskell.org/packages/archive/pkg-list.html#cat:sound
E.g. HSndFile for audio file writing, http://hackage.haskell.org/package/HSoundFile
the module pulse-simple exposes bindings to capture sound from the microphone, see the second example at the top of the page;
https://hackage.haskell.org/package/pulse-simple-0.1.13/docs/Sound-Pulse-Simple.html
pulse audio libraries required by cabal are obtainable via cygwin (search "pulse" in the cygwin installer).
there is a also binding to sox, which looks promising.
https://hackage.haskell.org/package/sox
im sure there are other api wrappers to be found in hackage sound category.
for linux there is a binding to jack, has "unix" as a dependency, it WILL NOT build on windows...
Just in case you're not familiar with hackage: http://hackage.haskell.org/packages/archive/pkg-list.html
It looks like there is some audio-related stuff there. Not sure if there is anything that will meet your needs. But most "mature" haskell libraries will be there.
You can do it with OpenAL and ALUT. I managed to install both on Windows 8, although it wasn't exactly effortless; ALUT requires the underlying C library to be compiled manually into a DLL.
Installing OpenAL - on the other hand - is as simple as downloading the SDK and typing cabal install OpenAL in the command prompt.
With ALUT, you can create OpenAL buffers from audio files (including WAV) and memory views.
I found an example of recording and audio playback here. It should be fairly straightforward to adapt the code to your needs.
Let me know if I left something out and I'll try to elaborate.

Resources