用于游戏的跨平台声音 API? [英] Cross platform sound API for games?

查看:33
本文介绍了用于游戏的跨平台声音 API?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有仅用于声音的 API?

Is there an API only for sound?

API,例如 AllegroSDL 为我提供了太多的需求.我只需要一个可以执行以下操作的库:

APIs such as Allegro or SDL provide too much for my needs. I simply need a library that can do something like:

InitSound();
Sound *door = LoadSound("door.wav");
PlaySound(door,volume);

如果它可以支持诸如 VorbisMP3.

It would also be great if it could support compressed formats such as Vorbis or MP3.

推荐答案

我是 SFML 库的忠实粉丝.它确实提供了额外的图形和网络功能,但与这个问题相关的是它还有简洁的音频包.

I'm a big fan of the SFML library. It does provide additional graphics and network features, but what is relevant to this question, is that it also has neat audio package.

音频功能是:

  • 尽可能使用硬件加速
  • 可以加载和保存标准声音格式:OggWAVFLACAIFF, AuRAW、paf、8SVX、NIST、VOC、IRCAMW64MAT4、MAT5 PVF, HTK, SDS、AVR、SD2核心音频格式、WVE、MPC2K、RF64
  • 可以直接从内存中的文件加载所有音频资源
  • 3D 声音空间化
  • 用于捕获音频的简单界面
  • 高效管理内存,让您不必担心资源的生命周期或存储
  • 支持大文件流式传输;您甚至可以为任何来源(网络,...)编写自定义流媒体类
  • 支持多声道格式(单声道、立体声、4.0、5.1、6.1、7.1)
  • Uses hardware acceleration whenever possible
  • Can load and save standard sound formats: Ogg, WAV, FLAC, AIFF, Au, RAW, paf, 8SVX, NIST, VOC, IRCAM, W64, MAT4, MAT5 PVF, HTK, SDS, AVR, SD2, Core Audio Format, 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)

网站:http://www.sfml-dev.org/

这篇关于用于游戏的跨平台声音 API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆