Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1025973 Posts in 41121 Topics- by 32720 Members - Latest Member: BluishGreenPro

July 23, 2014, 02:00:24 PM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)plaid/audio 0.2 - free portable audio framework
Pages: [1] 2 3 4
Print
Author Topic: plaid/audio 0.2 - free portable audio framework  (Read 8600 times)
Evan Balster
Level 10
*****


I live in this head.


View Profile WWW Email
« on: December 04, 2012, 08:43:28 PM »

Once again, the time has come for...

         __        _       _     _    __              _ _        __
        / /  _ __ | | __ _(_) __| |  / /_ _ _   _  __| (_) ___   \ \
       / /  | '_ \| |/ _` | |/ _` | / / _` | | | |/ _` | |/ _ \   \ \
       \ \  | |_) | | (_| | | (_| |/ / (_| | |_| | (_| | | (_) |  / /
        \_\ | .__/|_|\__,_|_|\__,_/_/ \__,_|\__,_|\__,_|_|\___/  /_/
            |_|
                        standalone audio framework
                              Version 0.2.0
                       Written with <3 by Evan Balster


<plaid/audio>
is a portable, extensible C++ framework for CPU-processed audio.  It is designed chiefly for use in games and other media-intensive software, and is most notably used in SoundSelf.

It offers a free (zlib-licensed) alternative to commercial audio middleware like FMOD.  Unlike the leading API, OpenAL, its behavior is consistent and guaranteed across platforms.

At present it offers classes for streaming and buffering audio files, playing back microphone input, manipulating streams with a selection of simple effects including pitch-changing, bandpassing and amplification, as well as mixing and splicing.

plaid/audio's scheduling system synchronizes audio with the program's framerate.  It does this by dividing output into "timeslices" for each call to update().  This allows games to render their audio at their graphical framerate, with any changes in audio effects, synthesizers or samplers being audible every frame.  Physics, animation or player input can thus have articulate audio feedback.


Extensive documentation is now available here.


A Visual C++ example project is included, which plays a little song.  It shouldn't be hard to build for other platforms; the audio engine code has previously been compiled for Windows, OS X, Linux and iOS, and the provided implementation layer (portaudio) is compatible with all but the latter.

Special thanks go to TIGS user randomshade of Pixelscopic, who hired me for the work of separating this code from my game engine, with the understanding that it would be opensourced thereafter.


Download:
plaidaudio_0.2.0.zip 588kb (alpha)
Demo Program (Windows) 237kb

Backwards code compatibility is not guaranteed with future versions.


Notable inconveniences at present:
- The only codec I've written is for OGG files.  Further, it uses stb_vorbis, which can be a little picky about its input.  If you control the files you use this isn't a problem.  I'll accept codec contributions if they don't add library dependencies.
- The Audio module expects wide strings for the purpose of specifying audio files.  (My game engine is unicode, but yours probably isn't)
« Last Edit: February 03, 2014, 04:27:46 PM by Evan Balster » Logged

Creativity births expression.  Curiosity births exploration.
Our work is as soil to these seeds; our art is what grows from them...


Wreath, SoundSelf, Infinite Blank, Cave Story+, <plaid/audio>
noah!
Level 6
*


View Profile
« Reply #1 on: December 04, 2012, 09:37:53 PM »

Wow, I've been looking through it, and this looks beautiful. It's like the sound library I've always wanted to make, only this one is programmed way more competently than anything I could do...

I look forward to getting some time to play with this, and I'm looking forward to seeing where you go with the library!
Logged
Belimoth
Level 10
*****


high-heeled cyberbully


View Profile
« Reply #2 on: December 04, 2012, 11:14:34 PM »

Impressive.
Logged

eclectocrat
Level 5
*****


Most of your personality is unconscious.


View Profile
« Reply #3 on: December 05, 2012, 06:27:32 AM »

Super cool, will play around with it.
Logged

I make Mysterious Castle, a Tactics-Roguelike
Graham-
Level 10
*****


ftw


View Profile
« Reply #4 on: December 16, 2012, 12:21:06 AM »

Are the main values: free and consistent?
Logged
Evan Balster
Level 10
*****


I live in this head.


View Profile WWW Email
« Reply #5 on: December 16, 2012, 12:56:29 AM »

Free, consistent, powerful, optimized for games.  With time I expect it to compare favorably with commercial libraries like FMOD.


I plan on making a second release soon.  I've fixed the Ref pointers being a pain in the butt and changed the MSVC project so it builds a static library.  If nothing else I should pack up those changes into a 0.1.1.  I would also like to write some decent documentation and provide more interesting example programs, but that might take a bit longer.  I might give the former a start tomorrow.

I'm super interested in any feedback anyone who's messed with this has.  Also I'd be interested to see anything that is made with the engine.
Logged

Creativity births expression.  Curiosity births exploration.
Our work is as soil to these seeds; our art is what grows from them...


Wreath, SoundSelf, Infinite Blank, Cave Story+, <plaid/audio>
Graham-
Level 10
*****


ftw


View Profile
« Reply #6 on: December 16, 2012, 01:13:54 AM »

Is FMOD slow? I have little (0) experience w/ these libraries.
Logged
Netsu
Level 10
*****



View Profile WWW
« Reply #7 on: December 16, 2012, 07:50:38 AM »

Sounds really cool Smiley Does it have positional sound? Might be interested in switching my game from my own OpenAL wrapper lib to this if I finally get around to finishing it. How big is the compiled lib?
Logged

Evan Balster
Level 10
*****


I live in this head.


View Profile WWW Email
« Reply #8 on: December 16, 2012, 11:51:22 AM »

Graham:  FMOD is great, it's just expensive.  This will be a free, more readily extensible alternative.

Netsu:  It doesn't have 3D sound, just a smooth-ramped pan filter.  (On some OSes all OpenAL's 3D positioning does is pan and amplification!)  It does support arbitrary output channels and writing a DSP for dolby 5.1 based on the Pan filter would be entirely possible.

The Visual Studio lib appears to be 13 MB, but a minimal EXE built with the thing (plus the provided implementation layer and OGG codec) is just just 234 KB.  The library is pure C++ and doesn't require anything except an audio implementation layer and optionally some file codecs, both of which I've provided.  On that note I should add my SDL audio implementation layer to the next release.
Logged

Creativity births expression.  Curiosity births exploration.
Our work is as soil to these seeds; our art is what grows from them...


Wreath, SoundSelf, Infinite Blank, Cave Story+, <plaid/audio>
Sergi
Level 1
*



View Profile WWW
« Reply #9 on: December 16, 2012, 12:11:41 PM »

This looks pretty awesome!

I have no idea whether this is possible or not: is there any way of using a library like this from Unity? Like, a compiled dll that can be written in any language, or something like that (I guess that would break portability)?
Logged

Evan Balster
Level 10
*****


I live in this head.


View Profile WWW Email
« Reply #10 on: December 16, 2012, 12:47:30 PM »

It's possible.  FRACT uses PD as its sound engine, interfacing with it through what I imagine to be DLLs.  You'd need to build the extensions for every target system and it would probably break compatibility with the web player.

My understanding, though, was that Unity's sound engine was FMOD, which was pretty full-featured as I recall.  Then again, you can write whatever kinds of audio effects you want with my system so that's always nice.  Smiley
Logged

Creativity births expression.  Curiosity births exploration.
Our work is as soil to these seeds; our art is what grows from them...


Wreath, SoundSelf, Infinite Blank, Cave Story+, <plaid/audio>
Graham-
Level 10
*****


ftw


View Profile
« Reply #11 on: December 16, 2012, 06:19:36 PM »

Ah. Maybe I'll learn something from it.
Logged
Sergi
Level 1
*



View Profile WWW
« Reply #12 on: December 17, 2012, 04:02:50 AM »

My understanding, though, was that Unity's sound engine was FMOD, which was pretty full-featured as I recall.  Then again, you can write whatever kinds of audio effects you want with my system so that's always nice.  Smiley

Oh, I actually didn't know much about Unity's sound engine. My knowledge is just "play music, play sound effect", but I just checked the docs and it seems to have a lot of stuff, including some effects with the paid version. Cool.
Logged

Gregg Williams
Level 10
*****


Retromite code daemon


View Profile WWW Email
« Reply #13 on: December 17, 2012, 05:39:09 AM »

We might give this a shot for our next major project. Kinda tired of fighting with the OpenAL platform inconsistances. Though we've also been considering irrklang.
Logged

Evan Balster
Level 10
*****


I live in this head.


View Profile WWW Email
« Reply #14 on: December 18, 2012, 02:16:14 AM »

I've discovered two high-priority bugs in the system which will be fixed in the next release.

The first is triggered by loading data into AudioClip objects at startup and causes multithread-related memory corruption in the Audio system's scratch-pool allocator.

The second is triggered by dropping a stream from a Mixer which has been denied scratch memory by the aforesaid allocator, and causes the audio callback to infinite-loop, creating a deadlock.  On one occasion this caused the Windows audio kernel to crash on me!  D:

Expect a new version with bugfixes, improvements and some documentation sometime this week.
Logged

Creativity births expression.  Curiosity births exploration.
Our work is as soil to these seeds; our art is what grows from them...


Wreath, SoundSelf, Infinite Blank, Cave Story+, <plaid/audio>
Pages: [1] 2 3 4
Print
Jump to:  

Theme orange-lt created by panic