Is DirectSound the best audio abstraction layer for Windows? - directx

Is DirectSound the best audio abstraction layer for Windows?
Switching my app from a very bad sound implementation, built to a specific chipset, to an abstration layer.
App is native Winform, .net 3.5. DirectX/DirectSound is the likely choice, but a little concerned about the overhead. Any other options? Or is it silly to even THINK about anything else?

DirectSound is not getting the same love from Microsoft today as it got in the past. As far as DirectX is concerned, you may try XAudio2 or XACT instead. Some people love those, others hate them. XAudio2 is more low-level, while XACT is rather high-level. Both are accessible from Microsoft XNA, which is like Managed DirectX, but is actively developed.
But you are not restricted to using what DirectX comes with. Try FMod if you want something great. They still have their Shareware/Hobbyist license model and a Freeware license model, in case you don't want to pay some big bucks.
Your choice depends on what exactly you want to do with sound.

See if SDL looks better.

Well, you can try OpenAL instead. What OpenGL is to Direct3D is OpenAL to DirectSound(3D). The interface is pretty similar to OpenGL, if you don't like that, you'll probably dislike OpenAL, too. Also I'm not sure if the Windows version of this lib is an own, native implementation or just calls DirectSound and thus might just be a (thin?) wrapper on top of it.

DirectSound is pretty good.
If you need low latency or good support for sound input and output via multiple soundcards at the same time you may also want to have a look at ASIO:
http://de.wikipedia.org/wiki/Audio_Stream_Input/Output

The waveOut... API is still an option. It's tricky to work with from managed code, but you can play multiple sounds at once this way (in XP and Vista, at least).
If you just need to play sounds occasionally, System.Media.SoundPlayer is very easy to use. However, you can't play more than one sound at a time with this component.
DirectSound is your only other major alternative. It has a built-in software synthesizer, if that's something you need.
EDIT: SDL looks interesting. Thanks, Sijin.

SharpDX looks interesting. I'm planning on trying it as a replacement for Managed DirectX because of the x86 limitations of the latter.

Related

Can i use Google Oboe or AAudio in iOS ? https://github.com/google/oboe

I want to use C++ library which makes it easy to build high-performance audio apps
https://github.com/google/oboe
Google Oboe seems for Android
can i somehow use it for iOS also ? or any similar alternative for iOS ?
I don't want to use Superpowered because of their licence terms!
There are no plans to release an iOS version of Oboe at present. You could look at FMOD or JUCE.
If I remember correctly (from videos of demos at events), The development of this library came from people heavily involved with the Google Android infrastructure, and thus the Oboe library is highly customized to tackle the low-latency short-comings of Android.
This being said, Google would not have the resources to tackle such an intensive and complicated problem for a completely different platform. As well (unfortunately) that wouldn't be in their best interest competitively-speaking.
I have heard of others using Superpowered, but I haven't gotten much info on it honestly, their marketing about it is all fluff, and there isn't any actual useful information, haha. I used Oboe myself, because I needed a dedicated native library.
As for iOS, I found a decent blog page that might be worth checking out: https://exceed7.com/native-audio/
This page suggests using OpenAL for objective-C/Swift. It looks like OpenAL is the similar implementation to OpenSL, which the Oboe library is partially based on. Unity seems to also utilize a library called FMOD (Not familiar with this one myself), as well DonTurner mentioned JUCE?.
So perhaps looking into these would be a good start, although I would assume using OpenAL might have some pretty involved developing, so ready your thinking cap!
Best of luck on your project!
Maybe you are looking for AudioKit
https://github.com/AudioKit/AudioKit

Library for samplerate conversion of audio data?

What is a good Delphi library for samplerate conversion of audio data? I don't mind paying for something.
I need to upsample and download sample audio in realtime. I understand the theory but don't want to write my own routines.
EDIT: Bonus points for something with Mac support.
You can check the unit "DAV_DspUpDownsampling.pas" in the Delphi Asio Vst Project. Although I've never used it I'm sure it would fill your needs.
Use SoX - the Swiss Army knife of sound processing. Very easy to use.
It is a command line tool not a Delphi library so to use from Delphi you need to execute a shell command and get the result with in your code. I have used it with PHP.
SoX is a cross-platform (Windows, Linux, MacOS X, etc.) command line utility that can convert various formats of computer audio files in to other formats. It can also apply various effects to these sound files, and, as an added bonus, SoX can play and record audio files on most platforms.
SoX is very mature project! Here is the link:
http://sox.sourceforge.net/
Dew Research's DSP Master could be an option for you.
Maybe Mitov software has components you can use
I use newAc in quite a few projects. It can do sample rate conversion.
The best news: It is free (also for commercial use)
Yes, you can use AudioLab from Mitov Software for that. It appears that nobody actually posted the link ;-), so here it is - http://www.mitov.com/products/audiolab.
Enjoy!
I use Bass Audio Library.
You can use Bass_Encode and a Bass_Mixer to samplerate conversion.
http://www.un4seen.com/bass.html
The Mitov components do this easily. I've made a short screen recording that shows the steps.
http://tinyurl.com/mitovaudio
The Mitov video and other components are equally powerful. We've used the Mitov libraries on major real-time video and audio processing projects with excellent results. Their support is excellent.
AFAIK, the components are free to evaluate and for non-commercial projects.
PS I believe he's a FireMonkey guy, so I'd guess that we can expect Mac support now or in the future.
You may want to take a look at Secret Rabbit Code (aka libsamplerate); it's a C library, but it should be quite easy to create a wrapper. The API is simple, and supports a wide range of operating systems and platforms (even embedded!).
It has a mature and very good quality code base, and it's extremely efficient. Support is also awesome, Erik is very responsive. Plus it has a huge user base.
Another option is libsoxr (which seems to produce better output, but is not so popular...).

Game Development in Delphi

I would like to have a go at making some simple games for personal/learning purposes. By simple games I mean games like platform, maze, arcade games for example. I would also one day like to create a platform game with a simple editor to allow others to edit and design their own game levels.
I am not sure if Delphi is the way to go though, I don't see or hear many people writing games in Delphi, but Delphi is the only language I understand on an intermediate level.
If Delphi is acceptable to create simple games as I mentioned, am I right in thinking that I would require some libraries that would help me do this, maybe Direct X for example?
I am using Delphi XE, I wish I had waited and upgraded to Delphi XE2 instead as it seems that includes some built in Drawing libraries.
I look forward to hearing your responses on this.
Thanks.
Check out Asphyre
And to encourage you; Soldat, C-evo and many more quality games were built with Delphi, Game Maker too.
There are to many options ...
If you are really new to this take a look at this site and get some good examples from children that try to make games Pascal programming for schools ...
If you are one level up here some library's that give you the a great start for small and big games... this is for new and very advance pascal programming...
GLScene just get the svn version... (Windows,MacOsX,Linux and hear for android and iphone ;) ) -- 2D,3D,isometric........
CastII Great engine (Windows,MacOsX,Linux) -- Mostly 3D....
Asphyre Sphinx 2 One of my favorite i allready start a big big game with that library... NOW (Windows32-64,MacOsX,Linux,and IOS) with DelphiXE2
ZenGL Fantastic and quite easy to use (Windows,Linux,MacOsX and i hear android too) --Mostly 2D but i hear 3D is in way out...
Castle Great library for me not to easy... (Windows,Linux,MacOsX) compine great with freepascal and lazarus...
Andorra 2d This is going to be the best but suddenly stops ... 2d programming at its best...
there are many other libraries and i here a few of them come out before the new year...
But if you go deeper you can try the hard way... the headers so ...
for opengl use the header from here delphigl
for SDL use the Jedi-SDL header (great by the way)...
for directX use the clootie and good luck...
But the most important thing in the game programming is the paper...
Every think write in the paper is the most value object in object programming...
Hope that helps...
Delphi is great for games! Here is a very good resource to get you started: http://www.pascalgamedevelopment.com/
It has a friendly forum where you can ask questions.
I have personally used Delphi for graphics programming for many years and written a free open source game engine in Delphi called ZGameEditor.
azrael11
GLScene doesn't support Android(work in progress as I know)
Cast II works only on Windows
Asphyre Sphinx 2 doesn't support Linux
ZenGL supports also iOS. Android - work in progress. 3D - I'm not interested in it currently, so only fast 2D is main goal.

What's best for your Video Tracking? Why?

Best as in reliable, maintainable and fast.
Considering Processing, VVVV or OpenFrameworks?
I know Processing doesn't handle big video frames very well.
VVVV (Nodes use OpenCV) is just for Windows.
OpenFrameworks (OpenCv) is more complicated than the
above.
You can try to implement your app in Processing and see if it fits your needs and is fast enough. It should a little more easy and faster to write Java instead of C++.
Here can you find how to setup with processing with examples: http://ubaa.net/shared/processing/opencv/
If you don't want to code anything you can try VVVV, should be little faster but only on Windows as you mentioned.
If your Processing app is running too slow, you can try openFrameworks.
download it the new OF 007 from http://www.openframeworks.cc/ and check out the setup guide.
If you have done the install you can play around with the openCV examples from
<your-OF-folder>/apps/addonsExamples/opencvExample
<your-OF-folder>/apps/addonsExamples/opencvHaarFinderExample/
Personally I prefer OF because you can do any custom thing with the most performance, but its good to make your prototype with Processing to see if it works and implement it after that again in OF.
As far as I can see from your question, VVVV and OF are the options your looking at, but you prefer VVVV's node based programming over OF, but aren't happy that VVVV is Windows only.
Have you considered other alternatives like MaxMSPJitter or PureData ?
Both are similar to VVVV or the other way around :)
MaxMSP has a package for 'optimized matrix operations'(3D/video) called Jitter.
For Jitter there is a cv.jit free collection of external objects and the samples/tutorials are great.
Similarly PureData has an add-on called Gem, which is similar to Max's Jitter package.
I haven't tried with PureData, but there are OpenCV bindings for it, through Gem.
cv.jit
pdp OpenCV PureData Bindings - via Piksel.no
MaxMSP uses quicktime on osx and can use directX on windows, but it's commercial.
PureData runs on windows/osx/linux, it's free and opensource.
HTH

Modern replacement for cbDSMixer?

I was working on updating a D6 media library to XE over the weekend. I got it working with a surprisingly low number of Unicode-related errors, but there are a few things I'd like to try to improve.
Unfortunately, the core of the player is cbDSMixer, which isn't all that flexible, and the author has stated that "Now with a family of wife and 2 kids I can't find the needed time to play around doing extra development so all those components are pretty old by now and mostly deprecated." So I wonder if there are any alternatives.
So does anyone know of an alternate media player library that will work properly under XE, and support the same or most of the same mixing and effects functionality as cbDSMixer?
You could try the Audio Component Suite from Andrei Borovsky. Not sure how much this lib is maintained, but it looks very promising (cross platform apparently, which may become even more important in the future)

Resources