I've manipulated the code for creating audio streams from files somewhat.

The WAV loader detects if the WAV file contains MP3-compressed audio.
If it does, it call the second half of the MP3 loader, handing it everything it learned from the WAV file header, then returns the resulting StreamingMP3Sound object, rather than a StreamingSound object as it normally would.

Great stuff, except that the mp3-compressed wav file I have been testing with uses a different SampleRate than my default secondary soundbuffers do - in other words, I'll need to set up separate decompression object for each audio stream as previously mentioned (its not just mp3-compressed wavs, this affects regular mp3 files with "nonstandard" SampleRates as well).

I "think" my existing code will now play an mp3-compressed wav IF THE SAMPLERATE IS CD-QUALITY (44100 Hz) - but I don't have such a file to test with.

Would really like such a file to test with BEFORE I go ahead with the changes I've outlined.

EDIT: I just tried changing my default samplerate to match that of the test file, and IT WORKS !!! WOOHOOOO!! YAYYYYY !!! I can play an mp3-compressed wav file, now I just need to be a little more intelligent about creating my sound buffers - still not absolutely SURE that I need separate decompression streams, but there is a way to find out!




Posted on 2009-12-08 03:56:51 by Homer
Hum... mp3... that reminds me. Many moons ago, at around the same time as I started working on the JPG decoder, a friend of mine at university (Ewald) was working on an MPEG player, and I had the idea to do the audio decoder for it. Never got to that point... but I'd have to look into the mp3 format, probably not all that different from JPG.
In fact, if you have a JPG decoder, you're already halfway an MPEG-1 decoder anyway :)
Posted on 2009-12-10 03:23:47 by Scali
Humm, initializing a CaptureBuffer causes an infinite loop on Win7/64 - and I have no loop code in there :)
I'm producing a loud annoying squeal on Win7/32 and Vista/64.
Everything works fine on Vista/32 and XP/32
Posted on 2009-12-11 07:50:04 by Homer
I've begun porting my audio engine's output side across to XAudio2 :| Not happy at all.
Capture will have to be dealt with independantly.
If OpenAL is really mature enough and can operate on all Windows NT and higher, it might be worth a closer look.
On the bright side, this has opened the door to two outstanding projects:
1> ObjAsmify (header converter)
2> Extending NetCom's IOCP framework to manage Asynchronous File IO
(This may be a good excuse to rename NetCom's core to something more geared toward 'general IO', I never liked the NetCom name because of the association with a particular corporation, but makes sense given its current incarnation).

Having to transcribe the header for XAudio2 finally pushed me into action - I'm writing a tool for converting .h files (ie Microsoft SDK's) into OA32-format .inc files : yes I'm aware of that old existing tool, but it's looking a bit tired, and given my narrow scope, I believe that it's worth starting from scratch.
In fact, after one night's coding, I already have something to be proud of (Biterider - got a lot more done after we spoke).

It's half way between a "pretty printer" and a context-aware preprocessor - it doesn't actually interpret anything, but it does notice what kind of programming block it is processing at any given time, and modifies its behavior slightly depending on the context. One thing it uses that for: these files generally contain buildtime switched logic (#if/#else/#endif) to include both C and C++ versions of the information - I'm stripping all the C stuff, while retaining and transcribing the C++ stuff. Also, I eliminate the IUnknown methods from interfaces which derive from IUnknown (it says IUnknown is the ancestor in the interface header - why do these methods need to be listed again?)
Anyway basically this application just does all the stuff I'd normally do by hand.

I'll post a beta of that in another thread over the next day or two, if anyone is interested.

Posted on 2009-12-13 23:48:32 by Homer
If OpenAL is really mature enough and can operate on all Windows NT and higher, it might be worth a closer look.


Well, if this list of games supporting OpenAL is any indication of its maturity...:
http://connect.creativelabs.com/openal/OpenAL%20Wiki/Games.aspx

Some pretty big titles in there, like Doom 3/Quake 4, Unreal Tournament... And 3DMark06/Vantage use it aswell. I bet that Futuremark's new game Shattered Horizon uses it aswell, since it's probably based on the Vantage engine.
Posted on 2009-12-14 02:25:47 by Scali
I'm still not convinced OpenAL is supported across Vista64/Win732/Win64.
There's a lot of people complaining.
Are they all idiots?
Just don't wanna waste my time.
Either way, my own .h to inc converter is well overdue - my asm has evolved, and the old tools suit the old tutorials and the old way of thinking, using the old version of ml.exe, on an old computer.
And I'm absolutely sick of doing these by hand.
Plus its cool to add a new tool to the OA32 toolbox.
Yay!

And extending the IOCP framework for asynch File (and perhaps arbitrary) IO is a sweet thing.

Biterider - your OA64 link points to a webpage that has OA32 as the feature of the text content.
Posted on 2009-12-14 04:43:28 by Homer

I'm still not convinced OpenAL is supported across Vista64/Win732/Win64.
There's a lot of people complaining.
Are they all idiots?


People always complain. A lot of them are indeed idiots. Many a time something doesn't work because of their own fault, yet they blame Microsoft or some hardware vendor.
I've played various games based on the UnrealEngine3, in Vista 64 and Windows 7 64. I've also ran 3DMark06 and 3DMark Vantage.
All of them use OpenAL, and all of them worked without problems. I would say that Epic and Futuremark have some of the brightest developers in the world. If they choose to use OpenAL (Vantage is actually a product marketed specifically towards DX10, so only Vista and beyond... would be rather stupid to choose a non-supported API, wouldn't it?), then I trust their judgement.

Does this sound like OpenAL is not supported on Vista?
http://connect.creativelabs.com/openal/OpenAL%20Wiki/OpenAL%C2%AE%20and%20Windows%20Vista%E2%84%A2.aspx
Posted on 2009-12-14 05:29:51 by Scali
I know it works on Vista32 - but so does DirectSound.
Was asking about Vista64, Win7/32 and Win7/64.
Posted on 2009-12-14 05:43:21 by Homer
DirectSound hardware acceleration doesn't work in Vista.
OpenAL does.
As I said, I use only Vista 64 and Win7 64. Works fine on there.
The difference between 32-bit and 64-bit is very small anyway. Besides, Microsoft enforces hardware vendors to have both 32-bit and 64-bit drivers, if they want to be entitled to using the "Vista/Windows 7 compatible" logo on their products.

Geez, come on... 64-bit is OLD. Vista is OLD.
I don't get it. Get with the times. You're a software developer for crying out loud. I assume you have a 64-bit CPU, because 32-bit CPUs haven't been on the market in ages... How come you've never even bothered to install an XP x64 beta, Vista x64 beta or Win7 x64 beta on your machine? It's free, and the experience is extremely valuable to developers. Don't just ask, do something on your own initiative.

All these people still screwing about with DX9, XP, 32-bit... Geez. That was 2002, a LOT has happened since. Try to keep up. And stop slowing us down.
Posted on 2009-12-14 05:49:36 by Scali
The fact is that 80 percent of Windows users are running XP SP2 or Sp3.
I'm interested in my market :)
Posted on 2009-12-14 05:57:29 by Homer

The fact is that 80 percent of Windows users are running XP SP2 or Sp3.
I'm interested in my market :)


Is that so?
According to Steam hardware survey, only about 50% use Windows XP. Windows 7 is the up and coming OS. And if you pay closer attention, you'll see that the 64-bit version outsells the 32-bit version among the Steam users (and Valve's own games are just DX9-only games, so it's not like the average Steam user is pushed to migrate to Vista/Windows 7 because of the games he wants to play).
Yes, I still use Windows XP at the office (ICT wanted to skip Vista, and isn't ready to migrate to Windows 7 yet, but they will, on short notice), but I don't play games there.
At home I use Vista or Windows 7. Know your market, know it well.

Besides, even if the majority of your potential userbase still uses Windows XP, that is no excuse.
You as a developer have to be ahead of your users. When your users start to migrate to Vista/Win7 (which they almost inevitably will, the next time they buy a new PC), you must already have adapted your software to run on these OSes.
At the very least you should already be aware of the potential problems and opportunities on Vista, an OS that has been on the market for 3 years now. I just don't find it acceptable that you haven't even bothered to look into potential issues until now... And only now you find that DirectSound is not accelerated, and you have to find some workaround... which you have to do by proxy, because you don't have a system with Vista or Windows 7 yourself (which you could have had, if you entered one of the free beta programs that Microsoft has offered).

Developers need to take responsibility. The least you can do is to install a free beta of a new upcoming OS, to see if your code still works, and if there are any performance problems. Microsoft gives you a free opportunity to solve potential problems with your software even before the new OS launches. All you have to do is take it, it can save your users a lot of trouble.
Posted on 2009-12-14 06:08:09 by Scali
Scali: adopted the next platform - yes. Requiring it - no. (Unless you have very good reasons to do so, like developing a game selling mainly on über-eyecandy requiring DX10+).

Also, keep in mind that there's a big difference between being a hobbyist developer and writing commercial code :)

Finally, it's lame that acceleration has been removed (even if it's not necessary CPU-wise, I'd still like to be able to use my hardware's features... we're not running linux, are we?). Why was it done? DRM issues?
Posted on 2009-12-14 06:11:48 by f0dder

Scali: adopted the next platform - yes. Requiring it - no. (Unless you have very good reasons to do so, like developing a game selling mainly on über-eyecandy requiring DX10+).


I never said anything about requiring it. Need I remind you that I had a pretty long thread about my engine recently, where I tried to create an integrated solution that supported DX9, DX10, DX11 and both 32-bit and 64-bit, which worked on XP, Vista and Windows 7?

I'm just saying that you should keep your eyes open whenever a new OS arrives, and spot any potential problems before they hit the mainstream.

Regardless, the first DX10-only games are already emerging.

Also, keep in mind that there's a big difference between being a hobbyist developer and writing commercial code :)


I'm speaking as a hobbyist. The aforementioned project is strictly a hobby project of mine.
In fact, at work we don't even support 64-bit yet (despite our main application being written in .NET, oh the irony). Our software supports Vista and Windows 7, although we're not allowed to run it on our work PCs yet :)
Only certain test systems, which do not log onto the domain, are allowed to run Vista/Windows 7 at this point.

I find that as a hobbyist you actually have less restrictions on trying new things and researching alternatives. At work, you often have strict rules and requirements, and many things quickly fall outside of the scope of a certain project, or there aren't enough resources to explore them.
But as a hobby, well... nothing that stopped me from installing a 64-bit OS as soon as I got my hands on a PC with 64-bit extensions... And nothing that stopped me from fixing the 64-bit portability warnings in my codebase even BEFORE I had a 64-bit OS installed. So I could transfer to 64-bit quite smoothly. My first working 64-bit DX9 demo dates from April 2006: http://bohemiq.scali.eu.org/forum/viewtopic.php?f=4&t=39
Still a year after the release of XP x64, but it's 3.5 years ago now, that's an eternity in computer years. I used a P4 back then, we've had two generations of CPUs since (Core2, Core i7)! And two generations of Windows aswell (Vista, 7)!
Likewise I could put DX9 development on ice and start to explore DX10 as soon as I bought a GeForce 8800GTS.
And I started the move to DX11 when I got access to the beta DX11 runtime in the DX SDK. I had working DX11 code before Windows 7 was on the market.

Finally, it's lame that acceleration has been removed (even if it's not necessary CPU-wise, I'd still like to be able to use my hardware's features... we're not running linux, are we?). Why was it done? DRM issues?


Perhaps it had something to do with the poor implementations of 3d sound and such... most people use onboard audio anyway, which generally is a software-only implementation. Companies like Realtek never quite got their 3d audio right. Things like occlusion just didn't work.
Perhaps Microsoft figured it'd be better to just have the OS handle it.

At any rate, Creative didn't agree with Microsoft's decision, and offered a solution via OpenAL. I think the hardware acceleration in Vista/Win7 is actually a big factor in the recent popularity of OpenAL among game developers. OpenAL existed before Vista (and Creative didn't develop it themselves, they acquired it from Loki Software), but the hardware acceleration gave OpenAL some nice leverage over DirectSound-related solutions.
Posted on 2009-12-14 06:26:41 by Scali
I can confirm that OpenAL works flawlessly on Win XP 64. AFAIK, "The complaints" are mostly related to people not knowing how to install/use Alchemy on Vista. And Creative has some terrible customer support service. Actually they can barely speak English. So I guess most of the problems could be solved if just someone could actually answer the customers' questions. I once had to explain to them what is the difference between the sound card driver (which I didn't need) and OpenAL native driver (which I needed). They didn't know the names of their software. They couldn't understand simple English sentences. And it was difficult to understand what they were trying to tell you using their super-broken English. So, yeah, I guess here lies the main problem with Creative. I actually never had any problems with the hardware, drivers, or OpenAL.
Posted on 2009-12-14 15:21:47 by ti_mo_n
I believe that 'DRM issues' exactly describes the removal of capture (and ACM) support.
This is nothing more than pandering to a powerful lobby group, to the detriment of the majority.

Only 50 percent? Where was this statistic taken from?

Regardless, if "only 50 percent" of my market is forced to endure dx9, I must cater to them.
Posted on 2009-12-14 23:52:12 by Homer

Only 50 percent? Where was this statistic taken from?


I already told you, Steam survey (and why do I have to state my source, and you just pull the 80% figure out of the air? Where did YOU get it from? Case of cognitive dissonance?).
You know Steam? The biggest online game store in the world? Originally developed by Valve for their best-selling HalfLife games?
See http://www.steampowered.com/hwsurvey
I think it's a very representative survey for the average gamer, considering the size of their userbase and the fact that Steam isn't just about the latest high-end games, but contains lots of older games, casual games, and Valve's own games aren't that demanding either. You'll find all sorts of gamers there. But no business machines to pollute the polls.


Regardless, if "only 50 percent" of my market is forced to endure dx9, I must cater to them.


Yes, but that's not what I was saying (obviously you should already HAVE XP/DX9 support, since it's been around since 2002, but since 2006 we also have Vista/DX10). I was saying that you should also have been paying attention to the OTHER 50%. So far you haven't even bothered to LOOK at 64-bit, Vista/Win7, DX10+, OpenAL, even though it's been around for years.
And that 50% is dropping fast. The survey is updated every month, currently XP is dropping at a rate of more than 1% per month.
Vista has been on the market for 3 years, and only NOW do you start to worry if perhaps your audio won't work on it? That's 3 years too late.

I still support XP/DX9 myself, reluctantly. But I don't just look back, I look forward aswell.
Posted on 2009-12-15 02:38:07 by Scali
So have you made up your mind yet?

- Will you give OpenAL a try to see if it is a good alternative to DirectSound on Vista/Win7/64-bit?
- Will you just accept the fact that DirectSound is not hardware-accelerated, but at least make sure the code works on Vista/Win7/64-bit?
- Will you just stick with XP and continue to ignore Vista/Win7/64-bit, despite XP's waning popularity, and Win7/64-bit's quick adoption?

I have a valid key for Windows 7 64-bit RC which is still valid for a few months (the RC hasn't expired yet, but you can't get keys from MS anymore). I believe it is set to expire in June 2010. You're free to use it as I have upgraded to a retail copy with a new key.
Posted on 2009-12-22 03:24:43 by Scali
Where did I say I was ignoring vista and win7?
I specifically asked about support for their 64 bit builds under OpenAl :|
Posted on 2009-12-22 04:40:58 by Homer

Where did I say I was ignoring vista and win7?
I specifically asked about support for their 64 bit builds under OpenAl :|



You're asking now, 3 years after the introduction of Vista, and Microsoft's move to software DirectSound. My conclusion: You have been ignoring Vista/Win7 all this time.
The fact that you are asking is a further indication of you ignoring Vista/Win7. If you had a Vista/Win7 installation yourself, you wouldn't have to ask, because you could just make up your own mind from your own experiences (which really is the only way, because who can guarantee you that someone else's experiences aren't a result of their own incompetence? Google for problems with any given technology and you're bound to find many hits. Nothing is completely idiot-proof).
And when people answer your questions, you just toss their answers aside, because apparently they don't fit with your view of the world. Why even ask when there's a chance you won't be able to accept the answer?
You asked if Vista/Win7/64-bit were supported by OpenAL. When ti_mo_n and I say they are, and they work fine in general, you say "I'm still not convinced". Why do you even bother to ask then, if you hold so strongly to your own preconceptions, which aren't even based on personal experience, unlike ours?

And you're avoiding the question *again*.

I don't even care if you use OpenAL or not, or whether you stick to XP or not. It's your attitude that pisses me off. Tossing aside OpenAL without even giving it a proper look, just because "sum pplz on teh intarwebs sez it si teh sux".
And how you appear to be living in the past, thinking that XP still has an 80% hold on the market.
Open your eyes man, and accept the truth.
I can fully respect someone who says "Okay, I know XP is on its way out, but I like it, and I'm sticking with it".
I can also fully respect someone who says "OpenAL just isn't my thing. I'll stick with DirectSound and accept the consequences. I don't consider software audio a big issue". In fact, I'm in the same boat at this point. My engine's audio was based around FMOD, which doesn't support OpenAL afaik, so I don't think it's capable of hardware acceleration on Vista/Win7. It is however low on my priority list at this point. It works fine across all versions of Windows at any rate, I have tested and verified that.

However, I have problems with people who aren't in touch with reality, and base their decisions on vague information and misguided arguments.
Gives me the same feeling as a large part of the linux/free/open source software world. I have nothing against open source itself, I have released some of my code under open source licensing aswell, and I've been a happy FreeBSD user for many years. However, when people spout arguments like "Commercial software is ev0l" and "M$ Windoze suxxx!!111oneone", I get a bad taste in my mouth. Like they live in some fantasy world.
The world isn't black-and-white. I use a lot of commercial software aswell, and although I could use FreeBSD on my desktop machine, I choose (operative word in this sentence: I have the freedom of choice) to pay for Microsoft Windows, because I consider it a superior product for that particular use.

Edit:
After a quick google, I found this document:
http://connect.creativelabs.com/developer/Gaming/SoundBlasterFMOD.pdf
Apparently FMOD has OpenAL support now. That would give me an easy way to support it. I just need to update to the latest version (which I haven't done in ages) and initialize it with OpenAL support. I'll give that a try tonight.

Edit:
Not THAT easy apparently. The OpenAL support is only available in the new FMOD EX API, and my stuff is still based on the old FMOD 3 API. I'd have to upgrade my code to use the new API first.
Posted on 2009-12-22 05:42:38 by Scali
Audio has not been the focus of my work, and nor will it ever be.
You sound like you need a vacation.
Posted on 2009-12-22 17:36:41 by Homer