开发者

Is there any sound SDK which works with .NET?

开发者 https://www.devze.com 2022-12-30 00:25 出处:网络
I\'m working on a C# XNA game, the most popular sound SDKs like开发者_StackOverflow MSS or FMOD mainly work with C/C++.Umm... Why are you searching for a sound SDK for .NET? XNA already comes packed w

I'm working on a C# XNA game, the most popular sound SDKs like开发者_StackOverflow MSS or FMOD mainly work with C/C++.


Umm... Why are you searching for a sound SDK for .NET? XNA already comes packed with XACT and totally supports it on multiple platforms.

Here's an MSDN documentation tutorial


NAudio works with .NET, but unfortunately I believe it makes a lot of use of P/Invoke. This means that while you would be able to use it from XNA on Windows, you will probably have problems if you need to have your code running on devices such as the XBox.


Actually it is not so bad, because you can call to c/cpp libraries from csharp, by using P/Invoke.
If you stay with windows, you just need to create (or find) a layer between C# and library of your choose.
There small example how to call function from cpp dll.


I agree with Avram above although I wouldn't pinvoke, I'd generate a wrapper using tlbimp.exe if you can, you should be able to find a type lib from one of your fave open source C/C++ api's then run tlbimp.exe on it.

That way you get all the perks of the api without the hassle of handling pinvoke / other unsafe calls yourself, the wrapper can handle all that hassle for you.

...

I would however question what it is you want to do with audio that you couldn't already do with a bit of whizzy coding yourself using the core .Net and XNA classes, if i's something crazy I have seen people do things like install a third party audiophile app and pull the dll's from that then pinvoke the methods in those (very hard work though).

If you want to avoid pinvoke calls altogeher you are pretty much bolted down to whats in XNA itself.

There are plenty of game engines out there though, may one contains some nifty audio classes you can borrow.


BASS works with .Net


What do you want to do with sound that you cannot achieve through XNA's audio playback capabilities? http://msdn.microsoft.com/en-us/library/bb195038.aspx

Note that if you call out to an external audio API, the chances of your code porting smoothly to XBox, WinPhone, etc., are significantly diminished.


There are .NET wrappers for FMOD (FMOD.net) as well as for BASS (nBASS).

I worked with both, I think FMOD.net is the best of both.

0

精彩评论

暂无评论...
验证码 换一张
取 消