What are the best affordable c++ audio libraries? [closed] - c++

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I'm looking for a c++ audio library that can play mp3s and mix audio. I can spend some money on it, but I'm on a somewhat tight budget, so the less the better. It really needs to just run on Windows and Mac OS X although Linux and embedded devices are a big plus. Anyone know of a good library or two?
Thanks!

From the game development world, you'll find a lot of good libraries. Obviously "mixing" doesn't tell what exactly you want to do but in a lot of games we mix tracks and sound to get some kind of ambiance so I guess it can be useful for you:
UPDATE: fmod now have a free indie license.
FMOD http://www.fmod.org/ : might be expensive even if they have a "casual" (think "indie") license. However, it's certainly the "standard" in the industry because it's uncontestably very powerful.
Irrklang http://www.ambiera.com/irrklang/ : have been used and recommended by several indie game developers. It's cheap, even if you buy the most expensive version.
Bass http://www.un4seen.com/ : used in several games so good quality, but more exepensive than Irrklang while cheaper than FMOD.
Clam http://clam-project.org/ : this is more free and flexible that the previous libraries but also might be too flexible for your need.
CAudio https://github.com/wildicv/cAudio : wrapping OpenAL with a C++ interface and adding higher lever constructs, it might not fit your need, depends, but also I'm not sure of the quality of the library; maybe worth a try as it's the most open-source of all.
If you are not pressed by time (or want to help), there is also Plaid/Audio, a promising software audio processing library which is still a work in progress but is extracted from the engine used by SourceSelf (a game which use player's sounds -like, your voice- as input).

I'd have a really close look at sox. It's excellent. We're using the sox C++ library to do real time transformation of RTP streams. Works well.

JUCE is an awfully nice portable toolkit for graphics and audio. The main architect created it for real time audio processing, but it's evolved into a wider range of tools.

No firsthand experience, but PortAudio is highly recommended.

Though it does do ten zillion more things that you don't mention, I can't fail to recommend Qt with Phonon -- I learned about it only earlier today (from another Q&A on SO!) and it's opening new frontiers for me. If you need even a tiny fraction of the incredible power of Qt, that's definitely something worth trying (LGPL, so free and unencumbered as long as you don't modify the library itself).

libmad - MPEG Audio Decoder
http://www.underbit.com/products/mad/

Have you looked at libavcodec? seems like it would be what you are after. You are able to grab it from the ffmpeg site.

Look at TempAu
It is lightweight and simple, crossplatform and plays mp3.

Related

Qt for non-UI application? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm looking to use Qt for a non-UI application. It has the potential to run on an appliance, but will start out on the desktop. The UI part (I know, I said non-UI) would be a web server with HTML(5)/AJAX.
I would really only use Qt for basic cross platform stuff like threads, synchronization, serialization, resources (strings, maybe images), internationalization, etc.
Which would be better for something like this, Qt or Boost and creating the cross platform layer myself?
Qt feels a little heavy for what I need, but I want to hear what experiences others have.
Yes, in my opinion it is perfectly OK. I wouldn't say Qt is heavy compared to Java, for example, which is extremely widely used for such tasks. Qt is very powerful, clean, easy and fast. I use it a lot, and I don't know any major drawbacks with it.
Yes, using QtCore (and other non-GUI modules) should do just what you need. As choosing between Boost and QtCore: both do good jobs and sometimes they interleave. But not always.
Qt(Core) offers mainly functionality. Boost offer mainly tools to achieve functionality. For example, you have templates and functors in Boost, not in Qt. OTOH, if you need message pumps and the like, you will only find those in Qt.
It really depends on what you are trying to achieve.
What you're proposing is perfectly reasonable.
You want to use a number of features (threading, etc. that you mention) across platforms.
Essentially you have a number of options, as follows:
Option 1 (Bad): Write your own cross-platform wrappers. You'd be reinventing the wheel, and you probably won't be able to tackle as many cross-platform cases and features as Qt already does. This option also means that whoever inherits your code will have to deal with your custom library instead of a well-supported and well-documented easily accessible library.
Option 2 (Not recommended): Use individual cross-platform solutions for every feature you want, like threading, networking, etc. This means that you (and your successor) will have to maintain compatibility with a large number of libraries in the future.
Option 3 (Recommended): Use a single, well documented, easily accessible library to meet all your needs. Qt fits the bill.

Beginner game-development in C++ and lua [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am a total Beginner in C++ and programming generaly.
I have watched a couple of hours tutorals of C++ and read alot about it (Could you recommend some tutorials?), but what I´ve come across and couldn´t understand was Librarys.
I want to develop games in C++ (I think, it seems most interesting atm).
I can understand that I need a library for game programming in C++, but I don't know much about what a library is specifically, and where to find these librarys.
Also, I´ve read that Lua should be good to script the games with. I would like to know if this is true?
If its true, I would like to know where to find tutorials for Lua?
If not true, what is good then?
Thank you for your time.
This is my first question here.
I apologise if it wasn´t a proper question for this website, or if the english was bad.
I still hope you can give me some kind of answer and/or response.
You may want to try out Löve2d, a framework across Windows, Linux, and MacOS X for writing games in Lua. It bundles various game libraries for sound, graphics, physics etc so that you don't need to deal with that directly, and it lets you focus on the writing of games.
A good library to get started with game programming is SDL. http://lazyfoo.net/SDL_tutorials has some great tutorials to help you get started (the most comprehensive and easy to understand that I've found), but you need to understand program structure and such to get some practical use out of the tutorials.
OpenGL is pretty standard for 3D game programming, but it's more advanced than SDL. I'd recommend making sure you understand at least basic C++ before you move on to game programming... http://cplusplus.com/doc/tutorial would be a good place to start.
Here you can get very good and complete video tutorial of cs Indian institute of technology
I'm sure someone will come along and post an essay answering your questions in more detail, but here are the short answers.
A library is nothing more than a reusable collection of code. People write code and package it up for other people to use in their own projects. Libraries you would need for games include libraries that handle graphics, audio, networking, font/image loaders, etc.
Lua is great to script games with. It integrates very nicely with C/C++. Visit Lua's home site for tutorials.
Check this link out http://cplusplus.com/doc/tutorial/ for libraries here is the STL http://cplusplus.com/reference/.
Here is a reference on Lua, http://lua.gts-stolberg.de/en/index.php?uml=1.
can understand that much that I need a library for game programmig in C++, but I dont know much about, what A library is specificly, and where to find these librarys.
#TheBuzzSaw already answers what a library is, so I'll answer where to find. But wait, before WHERE, you have to know WHAT library to use. There are a lot of game libraries out there, both low level (loosely coupled between components) and high level (tightly coupled). The low level ones have separate functionality for graphics, sound, AI, etc. processing and usually each functionality can be used for things other than games. While the high level ones "glue" them together to form something that's ready to use as a whole (for instance, it provides scene class with events, music, etc. you just have to set some values to use). Due to the many number of then, I can't really say where to find before you know which one to use. One quite complete one is SDL, it's a low level one. Allegro is another one.
Also, I´ve read that Lua should be good to script the games with. I would like to know if this is true? If its true, I would like to know where to find tutorials for Lua? If not true, what is good then?
Lua is good, and it's used a lot in games. Ruby is good, some games use it. Python is good as well. Basically, most scripting languages are good for game scripting. You just have to consider what language features your game required, how fast you want it to be usually contradict with its syntax flexibility, etc.

How to develop small software or application? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
Hya Gurus,
I've been learning c++ for 8 - 10 months and want to develop a software or small applications (i am self taught using some books) so just consider me as C++ entry level programmer.since i don't know win32 etc for GUI development i can use some library.
I know most of c++ features , data structs , algos and have read some c++ book and scott meyer's effective c++.
but problem is that i am unable integrate all my knowledge to build a software and i think i am a adhoc coder. when i see even small simulation or little application codes i understand the code sometimes (sometimes not since understanding them is hard by just seeing code) but i find even code of page 4 - 7 so large that i think i can't develop applications.
for e.g : if i want to develop my own chm reader or FTP or any appz or softw you consider serious coding, how do i develop it? then i find myself completely lost by just start typing code i know won't ever be able to develop it. (i feel 0% confident)
so what i want to know how programmers like you guyz learn to develop serious application when after drilling their teeths in c++ only, do i need some other books to learn how to develop software? or what is the process to become serious application developer ?
Any help is very appreciated.
P.S (Impotant) : i'd love if you could tell me how you became serious developer after learning C++ , what you had done etc pleaseeeeeeeeee. and any personal advices to me .
Edit:
I don't know UML or Soft Engineering , do i need to learn them?
Thanks a lot again ))
Programming large applications is a long and arduous process. Even with medium sized software.
Even the veterans need time to read new code. I remember just recently starting work on an existing software project that had around 150 classes. It took a while just to figure out how the basic input was handled, let alone the whole structure.
What you need to focus on is increase your confidence in building software.
Try creating something trivial, something you know you can program. Try to make it a bit bigger by adding some features, not much though, and keep doing that. Over time you will be a bit more confident in big code.
Programming takes practice and you need to keep at it. It might sound like a daunting undertaking but real confidence in a language takes years of practicing.
Look at the questions here about good software books as well.
I would suggest that you read up on the usenet groups on c and the books by Scott Meyers and Andrei Alexandrescu. Whey don't you try to find out what the Loki lib can do.
Also a good place to start is looking at the boost libs.
Find some small project that you like and see what you can learn, it is an iterative process.
You can also join an open source project.
Good luck,
Lars
you must have perform practicals every day and start with small application then watch project code i hope by performing practical you will easy to understand any code.

Getting starting with Parallel programming [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
So it looks like multicore and all its associated complications are here to stay. I am planning a software project that will definitely benefit from parallelism. The problem is that I have very little experience writing concurrent software. I studied it at University and understand the concepts and theory very well but have zero hands on useful experience building software to run on on multiple processors since school.
So my question is, what is the best way to get started with multiprocessor programming?
I am familiar with mostly Linux development in C/C++ and Obj-C on Mac OS X with almost zero Windows experience. Also my planned software project will require FFT and probably floating point comparisons of a lot of data.
There is OpenCL, OpenMP, MPI, POSIX threads, etc... What technologies should I start with?
Here are a couple stack options I am considering but not sure if they will let me experiment in working towards my goal:
Should I get Snow Leopard and try to
get OpenCL Obj-C programs to run
execution on the ATI X1600 GPU on my
laptop? or
Should I get a
Playstation and try writing C code to
throw across its six available Cell SPE cores?
or
Should I build out a Linux box
with an Nvidia card and try working
with CUDA?
Thanks in advance for your help.
I'd suggest going OpenMP and MPI initially, not sure it matters which you choose first, but you definitely ought to want (in my opinion :-) ) to learn both shared and distributed memory approaches to parallel computing.
I suggest avoiding OpenCL, CUDA, POSIX threads, at first: get a good grounding in the basics of parallel applications before you start to wrestle with the sub-structure. For example, it's much easier to learn to use broadcast communications in MPI than it is to program them in threads.
I'd stick with C/C++ on your Mac since you are already familiar with them, and there are good open-source OpenMP and MPI libraries for that platform and those languages.
And, and for some of us it's a big plus, whatever you learn about C/C++ and MPI (to a lesser extent it's true of OpenMP too) will serve you well when you graduate to real supercomputers.
All subjective and argumentative, so ignore this if you wish.
If you're interested in parallelism in OS X, make sure to check out Grand Central Dispatch, especially since the tech has been open-sourced and may soon see much wider adoption.
The traditional and imperative 'shared state with locks' isn't your only choice. Rich Hickey, the creator of Clojure, a Lisp 1 for the JVM, makes a very compelling argument against shared state. He basically argues that it's almost impossible to get right. You may want to read up on message passing ala Erlang actors or STM libraries.
You should Learn You Some Erlang. For great good.
You don't need special hardware like graphic cards and Cells to do parallel programming. Your simple multi-core CPU will also profit from parallel programming. If you have experience with C/C++ and objective-c, start with one of those and learn to use threads. Start with simple examples like matrix multiplication or maze solving and you'll learn about those pesky problems (parallel software is non-deterministic and full of Heisenbugs).
If you want to go into the massive multiparallelism, I'd choose openCL as it's the most portable one. Cuda still has a larger community, more documentation and examples and is a bit easier, but you'd an nvidia card.
Maybe your problem is suitable for the MapReduce paradigm. It automatically takes care of load balancing and concurrency issues, the research paper from Google is already a classic. You have a single-machine implementation called Mars that run on GPUs, this may work fine for you. There is also Phoenix that runs map-reduce on multicore and symmetric multiprocessors.
I would start with MPI as you learn how to deal with distributed memory. Pacheco's book is an oldie but a goodie, and MPI runs fine out of the box on OS X now giving pretty good multicore performance.

Suggestions of excellent examples of real C/C++ code [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.
I'd like to study some good C/C++ code. The code should:
be good in style and structure, presenting best practices
be a real life program (not an example or toy)
not too big so it doesn't takes ages to analyse it
Windows and/or Unix
I know there are 1000s of open source projects out there. But I'd like to hear your suggestions.
I am Java programmer and I am curious how good project in c/c++ is structured (files), granularity of classes/functions/files, documentation/comments, build tools etc.
Multiple suggestions are welcomed e.g. this is good windows example, that is good pure C etc.
I would specifically mention memcached. It's a great example of fairly short, readable code with a clear purpose.
Second, I would recommend the Apache web server. It's a fantastically well-run open source project that you'll learn a lot from, both about the language, as well as general design practices and networking/threading.
I'd vote for nginx: http://sysoev.ru/en/ as an example of a very good C programming style
Samba: a large, cross-platform (POSIX-based), pure C, very popular network server.
Samba has good developer documentation, and the code base itself is very well organized; I've had no problems diving into just about any location within the code to answer a question I had about its inner workings or to track down a bug.
I find the implementation of Lua is quite nice C source. But languages are a bit odd as an example project.
Diomidis Spinellis has some suggestions in his book, "Code Reading: The Open Source Perspective", Addison Wesley, 2003. ISBN 0-201-79940-5.
Perhaps the book could be useful to you.
URL http://www.spinellis.gr/codereading/
Google's Chromium is pretty huge, but you don't have to analyze it all to appreciate its clean, peer-reviewed structure.
Also, it's a good example of nicely done developer environment deployment.
Here's the main file for relayd, which is a daemon that handles load balancing and failover. It's nicely written, full featured, clean C code. It's big enough that you get a feel for a "real world" program, but not so big that you can't get your head around it with some work. Great for secure, well written networking code, daemons, etc.
Modesty aside, there's also a little tiling window manager for X that I've helped with. It's quite small but it's a real wm, and the other coders on it have high standards (and hold me to them!)... Nice for learning basic X stuff.
K&R has many good examples of real programs. For instance, on page 115 of the Second Edition there are two simple implementations of the echo command. From there, it might be interesting to see how the command was implemented over time. For instance, there is a version in the GNU coreutils source. A version derived from BSD can be found in BusyBox source.
It might be interesting to see how the newer versions compare to the textbook examples. Why are the programs that are used in real life longer? How much of the code is related to new features and how much is related to dealing with edge cases? How would you write the same code in Java?
As for C++ I would recommend you the Qt library sources and KDE's source code and its programs.
It's beautifully written code and the way that you should program in C++.
More C++ suggestions in: Examples of “modern c++” in action?