开发者

Open source libraries for sound effects in games [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.

开发者_开发百科

Closed 8 years ago.

Improve this question

does aybody know about an open source sound library in C++ or some other popular language that can be used in open source games for recreating sounds and especifically in car racing games to recreate engine sound?

Thanks


A long time ago, there was OpenAL and was moderately successful on Linux.

It's fairly easy, modelled around the OpenGL library principles.


While you got a few answers regarding how to output sound I believe that wasn't your question.

If I got your question correctly I think "Sound Synthesis" is what you are looking for.

All you need is a bunch of generators (e.g. Sine, Sawtooth, Noise) and filters (low,high,band); And combine these.

Next step would be adding LFOs (Low-Frequency-Oscillators) to modulate parameters of the generators and filters.

I'm aware that this is not the full answer you looked for, but sound synthesis is a science in itself and the above keywords should get you started on the right track.

As for realtime synthesis of SFX for games. Simple answer: Don't do it!

It's a waste of resources and - unless you have very strict size limits - the size of the samples used for SFX won't kill you.

For our current game the average sample has a(n on disk) size of around 7KB. (We use 16KHz, mono, ADPCM wavs most of the time.)


I've only trivially poked around with it, but SDL is a very popular, cross-platform, C++ game dev library. It includes support for graphics, sound, input.

I also recall that it's very modular. That is, it's less of a framework and more of a library than some other solutions. Give it a look.


Is there a specific reason you need open source, or is "source available" good enough? A popular one is fmod http://www.fmod.org

It is free for non-commercial products, and also offers sourcecode under a license. It is very popular and isused in many well known games.


The irrKlang sound engine is very popular amoung independent developers. It is free for non-commercial use and still very cheap, if you want to start earning some money with your game.

It supports all major plattforms (Windows, Linux, Mac) and has APIs for C++ and .Net languages.


I know it's an old question, but I think SFML needs to be represented here. SFML is available in C++, C, .Net (C#, VB.Net, C++/CLI, etc), Python, D, and Ruby, and is designed to be small and fast.

Features specific to audio:

  • Uses hardware acceleration whenever possible
  • Can load and save standard sound formats : ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam, w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64
  • Can load all audio resources directly from files in memory
  • 3D sound spacialization
  • Easy interface for capturing audio
  • Manages memory efficiently, so that you don't have to worry about resources lifetime or storage
  • Supports streaming for big files ; you can even write your custom streaming class for any source (network, ...)
  • Supports multi-channels formats (mono, stereo, 4.0, 5.1, 6.1, 7.1)

For the specific question of recreating engine sounds, usually games take a single looping sound and adjust the pitch. An open source game that does this very well is VDrift.


SDL is Good Option for Graphics/Sound

QT frame work has also good support for sound and graphics

PortAudio is also good option

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜