JCHub

  • Home
  • Category
    • A/V
    • WebRTC
    • Beauty of Programming
    • Linux
    • Windows
    • Moments of Life
    • Campus Life
  • Reference
    • API Reference
    • Utilities
    • AV Test
    • Doc
  • Message Board
  • About
JCHub
Code as My Sword, Lost in Obsession
  1. Main page
  2. Beauty of Programming
  3. Main content

irrKlang简介

2014年4月25日 2509hotness 0likes 0comments

irrKlang是一个跨平台的音频库,能够使用C++,C#以及所有.NET语言开发。

特点
提供强大高水平的API用于3D或2D应用中播放声音,比如游戏,科学可视化以及多媒体应用。 irrKlang 非商业用途使用免费。

支持的文件格式
irrKlang目前支持播放以下文件格式:
RIFF WAVE (*.wav)
Ogg Vorbis (*.ogg)
MPEG-1 Audio Layer 3 (*.mp3)[2]
Free Lossless Audio Codec (*.flac)
Amiga Modules (*.mod)
Impulse Tracker (*.it)
Scream Tracker 3 (*.s3d)
Fast Tracker 2 (*.xm)

除此之外,通过使用插件能很容易播放其他格式。

支持的平台
Windows 98, ME, NT 4, 2000, XP, Vista, Windows 7, Windows 8
Linux / *nix
Mac OS X (x86 as well as PPC[3])

3D音效
在所有平台与音频驱动上,irrKlang内置支持3D音效功能,可用于3D游戏中,效率高,而且不占用太多CPU。

支持的编译器与语言
目前支持如下编译器:
Microsoft Visual C/C++ 6.0 - 2012
GCC 3-4
All .NET languages (C#, VisualBasic.NET, Delphi.NET, IronPhyton, F#, Haskell.NET etc.)

音效
除了支持3D声音中的多普勒效应,目前也支持如下音效,包括在2D与3D声音中:
齐声
压缩
失真
回音
参量均衡
混响

简单的API
拥有极其简单的API,如下代码展示如何用C++播放MP3文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <iostream>
#include <irrKlang.h>
using namespace irrklang;
 
int main(int argc, const char** argv)
{
  // start irrKlang with default parameters
  ISoundEngine* engine = createIrrKlangDevice();
 
  if (!engine)
    return 0; // error starting up the engine
  // play some sound stream, looped
  engine->play2D("somefile.mp3", true);
 
  char i = 0;
  std::cin >> i; // wait for user to press a key
 
  engine->drop(); // delete engine
 
  return 0;
}

总之这是一个很容易使用的音频库,前面我用Ogre开发漫游系统时也用到了该音频库。Ogre中加入声音

This article is licensed with Creative Commons Attribution-NonCommercial-No Derivatives 4.0 International License
Tag: Nothing
Last updated:2014年4月25日

Jeff

管理员——代码为剑,如痴如醉

Tip the author Like
< Last article
Next article >

Comments

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
Cancel

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Related Posts
  • Nodejs C++ addon开发简介
  • Google ProtoBuf协议介绍
  • Intel Media SDK 内存优化(转)
  • 网络字节转换到本地字节的函数模板
  • 解决Ubuntu下vlc无法播放文件
Categories

COPYRIGHT © 2026 jianchihu.net. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang