Windows 8 - low latency audio - audio

I'm considering developing an app for the upcoming Windows 8. The app requires low-latency audio recording and playback, and I'm trying find out whether the OS will support that (as opposed to other platforms).
So what I'd like to know is:
Is there a low-latency audio API in Windows 8?
Will it be supported on platforms other than PC (e.g. tablets)?
Thanks!

WASAPI was introduced with Windows Vista as the low-latency audio API. It is available both to desktop and to Metro style applications on Windows 8. Because it is a very low-level API, using it is not simple, but it gives you the most power. It will work on both Windows 8 and the newly-minted Windows RT (Arm).
Also available is XAudio2 which is a slightly higher-level API which will be easier to work with. It is the replacement for DirectSound and is designed for game developers, but may work for your purposes. This also is available to both Windows 8 and Windows RT.
There is a bit of comparison of the two APIs at the bottom of this article. I would start with XAudio2 and move to WASAPI only if you find XAudio2 doesn't meet your needs.

I would consider using XAudio2. Microsoft providers Basic audio playback sample for easy start

Yes, there is a low latency API you can access. It's called WASAPI
From my understanding, all tablets/Laptops/Desktops/anything running Windows 8, will have access to it. The only downside is that it's harder to work with (because it's lower level), but you get to directly interact with the byte arrays getting send to the speaker, and the latency is very low.

Related

Does DirectSound usually support echo cancellation and noise reduction?

I'm currently using the waveInOpen set of Windows API functions to record audio for a VOIP application. I'm now being asked to add echo cancellation, and possibly noise reduction, and gain control. I know nothing about DirectSound, but while searching on "echo cancellation" on Google I came across references on MSDN to DirectSound such as CaptureAcousticEchoCancellationEffect.
If I switch to DirectSound will I get some of these features "for free"? Are they only supported if the hardware supports it, and if so, how often will that hardware be present in the average consumer PC?
Starting with Windows Vista, Microsoft provides a separate component Voice Capture DSP:
The voice capture DMO includes the following DSP components:
Acoustic echo cancellation (AEC)
Microphone array processing
Noise suppression
Automatic gain control
Voice activity detection
Applications can turn each component on and off individually.
You can use it in your DSP application to leverage EAC and NS implemented in software.
As far as I know these features are not professionally supported in DirectSound. A hardware device that has support for these features usually is equipped with a special processor/DSP and costs a lot more than the standard hardware device.

Low level audio programming

I wonder; does audio software like Cubase and Audacity use PlaySound calls??
Where can I learn about low level audio programming? As far as I've found information on the web, MCI seems to be the lowest level audio API in Windows...
Thanks
Edit: I don't ask for information specific for Windows only.
There's several audio APIs to choose from. The oldest and most widely supported is the waveOut API - look for functions starting with waveOut in MSDN. A slightly newer one is DirectSound which is geared more towards games, but it's main feature over waveOut is positional 3D sound which professional audio software doesn't use (it was also supposed to have lower latency than waveOut, but that never really materialized). For low latency audio, there is ASIO. Professional audio apps support this API, but not all drivers do (it's a standard feature in professional sound cards, but not gaming or on-board hardware). ASIO can provide much lower latency than waveOut or DirectSound. Finally, there's the kernel streaming interface, which is the lowest-level audio interface still accessible from user-mode code. This is a direct pipe into Windows's internal mixer which combines output from all apps that are currently playing sound into the signal that gets sent to the sound card. It's scarcely documented though. There's a driver called ASIO4ALL (just google it) that provides ASIO support on soundcards without ASIO drivers by implementing the ASIO API on top of the kernel streaming interface.
I'm a little late to the game here, but I posted a Windows API history last week that might add a little more context. The choice of API really depends on your needs. If you want to avoid 3rd party libraries, it really only comes down to MME, XAudio2, and Core Audio (WASAPI).
A Brief History of Windows Audio APIs
Hope this helps!
Actually, if you are looking for more than Windows-only output support, then the best way to start is to review Phil Burk's PortAudio, available as of this writing at http://www.portaudio.com/ .
ASIO is a good quality interface, but it's proprietary and owned by Steinberg.
There are many lower-level interfaces to audio output than MCI in modern Windows. These include, at least, DirectSound, XAudio and WASAPI.
I recommend avoiding the Windows APIs as much as possible, and learning PortAudio instead.

Which mobile operating systems support J2ME?

I've been tasked with using WURFUL to determine whether or not a mobile browser is capable of downloading a J2ME app developed by my company.
I first thought I could use the "device_os" tag and filter by that, however, I'm unsure what the complete list of J2ME OS's are... any ideas?
I've been told there are no MIDP requirements, and that the application will run on any J2ME-supported handset (with two specific resolutions, which I already know how to query)
Thanks in advance.
There is no way to know all the OSes that support J2ME. Mainly because most feature handset comes with a proprietary OS which probably you have never seen before. It is a better idea try to identify the handset model and decide if it supports J2ME or not.
Another thing is, you may want to know which JSRs are supported by a specific handset. I do not know your application but probably you are using some optional JSRs that are not supported by some handsets although they have basic J2ME support.
Java ME SDK 3.0 includes a database of supported devices. Also there are other web sites that provides these kind of information. One example to those would be this J2ME Handsets web site.
If you are fine with just covering a large range of phones, you should include Symbian S60, S40, Windows Mobile, Blackberry and Android.
Symbian
Win Mob
Android
Almost every Sonyericsson phones
IMHO you don't have to worry about how many handsets support j2me because majority of the phones support it.
At least Symbian and Android.

Best cross-platform audio library for synchronizing audio playback

I'm writing a cross-platform program that involves scrolling a waveform along with uncompressed wav/aiff audio playback. Low latency and accuracy are pretty important. What is the best cross-platform audio library for audio playback when synchronizing to an external clock? By that I mean that I would like to be able to write the playback code so it sends events to a listener many times per second that includes the "hearing frame" at the moment of the notification.
That's all I need to do. No recording, no mixing, no 3d audio, nothing. Just playback with the best possible hearing frame notifications available.
Right now I am considering RTAudio and PortAudio, mostly the former since it uses ALSA.
The target platforms, in order of importance, are Mac OSX 10.5/6, Ubuntu 10.11, Windows XP/7.
C/C++ are both fine.
Thanks for your help!
The best performing cross platform library for this is jack. Properly configured, jack on Linux can outperform Windows asio easily (in terms of low latency processing without dropouts). But you cannot expect normal users to use jack (the demon should be started by the user before the app is started, and it can be a bit tricky to set up). If you are making an app specifically for pro-audio I would highly recommend looking in to jack.
Edit:
Portaudio is not as high-performance, but is much simpler for the user (no special configuration should be needed on their end, unlike jack). Most open source cross platform audio programs that I have used use portaudio (much moreso than openal), but unlike jack I have not used it personally. It is callback based, and looks pretty straightforward though.
OpenAL maybe an option for you.

How to programmatically use the mobile phone's IrDA to remote control a media player?

which API or library on which mobile OS is to be used when one needs to write a code to use the phone's IrDA to create the necessary impulses to remote control consumer electronics e.g. a HDD media player?
Is maybe a certain mobile OS better suited for that kind of application than others?
First you need to know that IrDA is not the best choice for remote control. It can be done, but IrDA is by design high speed/low range, you can emulate low speeds but ranges (IMO) are far from practical usage (Nokia e50 is able to control digital camera shutter from 2-3m... with very, very careful aiming). The amount of hacking needed to achieve this is shown here, you basically need to trick IrDA to send correct impulses with correct frequency.
The second thing is that CIR remote control is not as simple as you might think. There are countless standards that differ in used frequency, modulation, wavelength, command codes and so on. You need to know what you want to support. LIRC site can be very helpful in determining that http://lirc.sourceforge.net/remotes/. Approachable explanation of what it all means is available here: http://www.sbprojects.com/knowledge/ir/ir.htm
As for ready made libraries and platforms... I honestly don't know. I've seen it done on PocketPC (nevo among others) and Symbian S60 (irRemote). Haven't seen working J2ME app yet.
Last time I needed the IR remote I hacked it together using IR diode, AVR ATTiny and surprisingly short piece of assembly :)

Resources