Play sound on certain speaker - c++ [closed] - c++

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Which free C++ audio library could I use to play sounds(mainly sines) on a certain speaker, in a stereo system ? I know I could create sounds that play only on the left/right channel, and then simply play these, but this doesn't help me. My target is to play a frequency on the left speaker, and another frequency on the right one.
Thanks in advance :)

You might give idea about your OS. Anyhow have a look at following list of libraries:
Free Sound and Audio Libraries - set of crossplatform OpenSource audio libraries.
CLAM - (C++ Library for Audio and Music) - is a full-fledged software framework for research and application development in the Audio and Music Domain. It offers a conceptual model as well as tools for the analysis, synthesis and processing of audio signals.
Kowalski - Description of projectWindows/OSX/iOS.
Soundtouch - is an open-source audio processing library for changing the Tempo, Pitch and Playback Rates of audio streams or audio files
BASS - is an audio library for use in software on several platforms. Its purpose is to provide developers with powerful and efficient sample, stream (MP3, MP2, MP1, OGG, WAV, AIFF, custom generated, and more via OS codecs and add-ons), MOD music (XM, IT, S3M, MOD, MTM, UMX), MO3 music (MP3/OGG compressed MODs), and recording functions. All in a compact DLL that won't bloat your distribution.
To use Stereo under Windows have a look at this sample project

Related

Good library for realtime audio (both sending and receiving)? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm thinking about doing realtime audio chatting stuff node.js. However, there currently aren't any good libraries for node for this that I know of. For recording audio, I'd probably open an audio device and read PCM bytes from it - however, I'm not sure about how to go on. I want to have control over the network stuff, e.g. I want to be able to multiplex the traffic through an existing connection, so a library that also handles the network part wouldn't work for me. So, what I think I need:
a C/C++/JavaScript library that is able to do fast (maybe lossy) realtime audio (de-)compression (maybe optimized for compressing human voices)
a C/C++/JavaScript library that can ensure that things stay realtime, e.g. takes care of dropping data after jitters - maybe I could also do this part in JavaScript myself
Does this sound sane? What are good libraries for these things?
I've created a C++ audio library named "Crosstalk".
It's a real-time C++ audio engine that allows you to create and route audio systems in real-time. Basically, the engine takes care of all the audio routing and gives you a simple platform for creating system components (E.g. "Network Input Feed" component connected to a "Low-Pass Filter" connected to a "File Recorder").
It's very easy to use. Here's an example of how to play an mp3 file (These components are provided with the engine):
XtSystem system;
XtMp3Decoder mp3Decoder;
XtAudioDevice audioDevice;
long md = system.addComponent(&mp3Decoder);
long ad = system.addComponent(&audioDevice);
system.connOutToIn(md,0,ad,0);
system.connOutToIn(md,1,ad,1);
mp3Decoder.loadFile("../05 Tchaikovski-Swan Lake-Scene.mp3");
mp3Decoder.play();
You can check out the API documentation and licensing details here: http://www.adaptaudio.com/Crosstalk
Update: Compatibility with free licenses.
Only the demo version of Crosstalk may be used in conjunction with free licensed software, however, commercial use and distribution of Crosstalk is still not allowed. If you wish to use the Crosstalk demo in free software, just mention in your EULA that your program uses a demo version of Crosstalk, and wherever you provide a link to your software, provide a link to: "http://www.adaptaudio.com/Crosstalk", where they may download it themselves.
EDIT (01-12-2012):
Crosstalk has been replaced by an open-source project called "DSPatch". DSPatch is essentially an upgraded version of the routing engine behind Crosstalk that is no longer limited to only audio processing. DSPatch allows you to create and route almost any type of process chain imaginable, and free for personal AND proprietary use :)

Which API should I use for playing audio on Windows? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
There are many ways of playing sounds on Windows. Which are the differences, advantages and disavantages of each method?
I know there are at least 5 methods:
1991 WinMM.dll/mmsys.dll PlaySound
1995 MCIWnd (as suggested by #casablanca)
1996 DirectSound
1998 WaveOut
1999 ASIO
1999 Windows Media Player ActiveX control?
2005 WASAPI (which is used by XAudio2 - as suggested by #Han)
2007 XAudio2
QSound, then it will fit right in with the rest of your Qt application, and it will work not only on Windows but also on Mac OS X and Linux, as well. It is not uncommon to find a core, platform-specific API that isn't very friendly to developers, and then a myriad of more developer friendly APIs built on top of the core. Using a core API may be negligibly faster, but using the layers on top of these core
APIs is almost always more convenient and maintainable, and protects you from changes to the low-level core.
Edit
From the description of XAudio2:
XAudio2 is a low-level, cross-platform audio API for Microsoft Windows and Xbox 360. It provides a signal processing and mixing foundation for games that is similar to its predecessors, DirectSound and XAudio. For Windows game developers, XAudio2 is the long-awaited replacement for DirectSound.
So, it looks like that would be the API to use if you want a core, platform-specific audio library.
Edit 2
I was a little quick with my first answer... really, it depends on what you want to do. If all you want to do is play an audio file, then QSound is the way to go. If, however, you want to mix and generate audio on the fly, then using a more feature-capable library such as XAudio2 (which is a part of DirectX and is intended for creating sound as part of video games) would be the way to go.
Really depends on what you want to do. For most common scenarios, I've found that the MCIWnd functions work well: they're really easy to use and can play any format for which a codec is installed.
DirectSound is somewhat more difficult to use but gives you much more control over the output; it lets you add special effects and simulate 3D positioning.
The waveOut functions are the lowest level API you can get to and they are a kind of double-edged sword: you get to control exactly what goes out to the speakers, but they accept only raw waveform data, which means you are responsible for all decoding and post-processing of input data. PlaySound essentially provides a nice wrapper around this.

How to write C++ audio processing applications? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I'm an Electronics and Telecommunications student, next to my graduation. I'm gonna work on a project that involves my knowledge about DSP, music and audio in general. I allready know all the basic mathematic instruments and all the stuff I need to manage it, such as FFT, circular convolution ecc ecc.
I want to learn C++ programming basically for one reason: it's very important in the professional world!!! And I think it's one of the most used to write applications working with audio, especially when it's about real time processing.
Ok, after this small introduction I would like to know first, which are the most used libraries to work with audio processing in c++?? I was longer looking on the web but i couldn't find a lo of working stuff. (I work under linux with eclipse CDT enviroment).
Then I would like to know if there are good sources to learn how to write some working code, such as for example how to write a simple low pass filter. Basically now i will not write real time applications, I would like to start from the processing of a WAV file, or even better an MP3 file, so basically on vectors of samples.
Let's say that basically for now I would like to extract the waveform from an audio file, and save it to a thumbnail or to a PNG image.
Ok, for now I think it's all I would need.
Any ideas, advices, libraries, books, interesting sources about that?
Thanks a lot in advance for any kind of answer.
Giovanni.
I would suggest for you to write your own WAVE file reader and writer in C++, without relying on external libraries. The WAVE format is fairly straight forward, at least if you only intend on supporting the most common wave files.
Then you'll have access to the audio data, which you can easily manipulate in C++. I would recommend starting by modifying the volume, the number of channels to calculating statistics on the audio. Creating a PNG of the audio waveform requires some more advanced C++ skills...
Checkout this link which will give you some information on the available (commercial and open source) audio editing softwares.
Some interesting open source audio editing tools which are written in c++,
Audacity
LMMS
Qtractor
Ardour
Rosegarden
C++ library for audio processing.
SndObj
The Synthesis ToolKit in C++
C++ Code and links related Filters and audio processing..
C++ code for Filter,Audio Processing
Code Guru,Low pass filter
I've used BASS with good results (there's a C/C++ API you can use).

Best Technology for a medical 3D Planning Software [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I am looking to build a new Interactive 3D planning software similar to this one http://www.materialise.com/materialise/view/en/131410-SimPlant.html
I was looking for some expert advise about the best technologies to use to build the different components of the software (ie: UI, Image processing, visualization, 3D, etc.. )
The software need to be able to process the images very quickly and in the same time I need to be able to deliver the software to the market fast, so the technologies used should allow for both rapid application development, and high performance. Any advise would be appreciated
Take a look at VTK (vtk.org) for an general purpose visualization toolkit and the ITK (itk.org)
which is an image analysis toolkit built on top of vtk. Both are BSD licensed.
The Python Imaging Library, PIL, is a good compromise between speed-to-market and good performance (and you can always use scipy and its core part, numpy, to enrich it for more advanced image-processing needs, if you pick Python as your pivot language!-). Similarly, visualization (including 3D) are excellently covered in third-party Python extensions -- check out EPD, the Enthought Python Distribution, for a good idea of what libraries might best help you in such tasks (you can always build your own versions if you don't want to partner with Enthought for commercial distribution... but it might be worth checking them out, as they have excellent commercial contacts as well as tech skills;-).
When and if you want to dip down into C++ for some specific component, Boost.Python, SIP, or Cython will make it child's play to integrate the component into your Python mainstream. For UI &c, PyQt is great...
In other words, while I'm obviously biased, in your shoes I'd unhesitatingly go for Python as the "core" and investigate the various options I've mentioned for visualization, UI, etc, etc. One caveat: for quick time-to-market, stick with Python 2.6: the newest 3.1, while great in many respects, is likely to still miss compatible versions of many third party extensions that will make your life way easier and sweeter with Python 2.6!
ITK is not built on top of VTK, although they are related. One can easily process data with ITK and then switch to a VTK pipeline for the visualization and interaction functionality.
We have built fairly large and complex medical image processing and visualization applications (experimental, surgical planning) in Python using a combination of VTK, ITK and wxPython. The licensing of all these components is such that you can use them in commercial applications.

Learning about Computer Vision [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I am really intrigued by the field of computer vision and the potential it has. Are there any examples (preferably implemented in .NET) which I can study along with a reference book?
Sample Vision Code
Vision Source Code - Carnegie Mellon University
Open Source Computer Vision Library - Sourceforge
Computer Vision Test Images
libsift - Scale-Invariant Feature Transform implementation
C# wrapper for OpenCV
Resources
Computer Vision Online - Computer Vision Online
Computer Vision "Home" - Carnegie Mellon University
Lecture on Vision Systems - Cardiff School of Computer Science
Lectures on Computer Vision Systems - The University of Nottingham Computer Science Department
Feature Detection - Wikipedia Article
Scale-Invariant Feature Transform - Wikipedia Article
Stack Overflow Questions
Where do I learn about Image Processing and Object Recognition?
Image Processing Textbooks?
Computer Vision References
OpenCV (Open Computer Vision) is the most popular library, and it has been wrapped for C#:
http://www.codeproject.com/KB/cs/Intel_OpenCV.aspx
Some discussion about this wrapper and the library in general is here:
http://coolthingoftheday.blogspot.com/2008/08/opencv-open-source-computer-vision-for.html
-Adam
While the OpenCV library is interesting to use, it doesn't offer a lot of transparency as you learn. If you're interested in actually learning about the field, I would recommend looking into low-level image processing libraries and implementing your own Computer Vision applications. Once you've coded your own basic CV applications, using the OpenCV library becomes a lot easier. I would suggest the following topics to advance quickly through the basics:
sobel operators for edge detection
trying your hand at color segmentation
reconstructing 3d information from stereo images using disparity maps
Here's a site with some good test images (http://www.cs.cmu.edu/~cil/v-images.html).
I also found a good resource of course slides that cover the majority of these topics at (http://www.cs.nott.ac.uk/~tpp/G5BVIS/lectures.html)
Happy hacking =)
Here's a large collection of code, toolkits, and apps you might find useful
http://www.cs.cmu.edu/~cil/v-source.html
You could start by looking at some of the similar questions on this site:
where-do-i-start-learning-about-image-processing-and-object-recognition
image-processing-textbook
computer-vision-reference
I can also look at these two sites:
http://www.cs.cmu.edu/afs/cs/project/cil/ftp/html/vision.html
http://www.cs.cf.ac.uk/Dave/Vision_lecture/Vision_lecture_caller.html
The sites provide information, tutorials and code examples, even though they are not actively maintained anymore.
There is the OpenCV project on sourceforge with a book that you can get as well. You can see it here. However, that is not a .NET solution it is C
I recommend Open Computer Vision Library. It's much spoken of and looks promising. It even has an O'Reilly accompanying book :)
The Open Computer Vision Library has >
500 algorithms, documentation and
sample code for real time computer
vision. Tutorial documentation is in
O'Reilly Book
I've done a bit of work with SIFT in the recent past and it seems to be a rather interesting modern algorithm for feature detection, which is one of the major (and perhaps more advanced) topics within machine vision. Someone has written a C# library for SIFT with a pretty nice example that can automatically stitch together separate photographs of the same scene. Admittedly, this isn't a very complete answer, and I can't recommend a reference book, but hopefully it should be of some use to you anyway...
The AForge.NET library is pretty good and is written in C#, with the source available here.
Supported features are:
AForge.Imaging - library with image processing routines and filters;
AForge.Vision - computer vision library;
AForge.Neuro - neural networks computation library;
AForge.Genetic - evolution programming library;
AForge.Fuzzy - fuzzy computations library;
AForge.MachineLearning - machine learning library;
AForge.Robotics - library providing support of some robotics kits;
AForge.Video - set of libraries for video processing etc.
The algorithms are maybe not as cutting edge/academic as some of the other answers but a lot of the engineering problems taken care of (getting video into your application, etc).