RT:Has anyone tried writing an external sound system?
Since Unity has to load ALL the sound effects into memory at once (or suffer huge lag as it grabs them from resources) … I wonder if there is a better way through Obj-C?
Would be really sweet to not have to load everything into memory (since we’re all suffering from tiny memory of death syndrome!)…
I’ll give this a go sometime during the next year, probably. First need to get a Pro license. I’m thinking of using PortAudio and building my own architecture on top of that, or to build PureData as a plugin.
The advantages of using PureData would be huge! It’s a ready to use environment in which you can produce real-time sound synthesis and processing systems extremely fast. Sound designers and composers generally pick up PD programming quickly enough, so they won’t need as much assistance from the programming team once they get going.
Plus, if the port is done really well, you could even program patches in PD live while the game is running, completely fitting into the Unity style of working.
Actually, writing about this makes me wonder why the Unity team have not tried this themselves. This shit would be hot. Unity would be the first engine to allow an explosion of creativity and innovation in the sound department, giving way to allaround better sound design, and sound and music oriented games.
How this fits in with your iPhone problem I don’t know. I kind of rambled my way through this post.
There are plenty of sound engines out there if you use your good buddy Google. Apple gives one away with their sample projects. SIO2 has it’s own sound engine (very, very thin wrapper around openAL). Cocos2d has a sound engine and several user created sound engines. Every single one of these sound engines that I have seen loads all sounds in advance.
OpenAL works very much like OpenGL’s texture system in that you have to load the sound files in advance and then use the returned id to play it. The iPhones super slow flash drive would never work for loading sounds on the fly. Try it yourself to see.
Procedural sound would be really nice on the iPhone. My only fear with something like that is that programmers will be creating sound effects which can’t result in anything pleasing on the ears…
Wow… a PD plugin for Unity would really be amazing! I wonder if PD has been integrated into any game engines before. It would really create some amazing possibilities. I’d love to play with that.
As for the iPhone and PD, there is already the RjDj project which is really cool: http://rjdj.me
You can download the RjDj Composer Pack to get a package of special iPhone PD objects that let you access the accelerometer, touchscreen, etc here: http://more.rjdj.me/composer/
I would imagine that on the iPhone, the overhead for running PD and Unity might be a bit much for the time being, but it would be really cool too![/url]
RJDJ is the prime exampe of using PD on iPhone. :o For a PC/Mac application: PD has been used for generative music in Spore. (Shame they kept their ported code to themselves, but yay for using it!)
Tinus - Keep rambling about Pd and we might get somewhere! Seriously, start a new thread about it (you know more than I do) and see if we get some takers. There are a few threads on Max and Unity (give a search) but nothing really comes up for Pd. Post anything you come across. Thanks!
I’ll be sure to do that! I’ve done some related projects in the past that might spark some imagination, I’ll see about posting a synopsis and some videos soon.
Sorry to be a killjoy, but have you even read the previous posts?
I think the important points were:
There’s a bunch of audio solutions available, such as OpenAL for desktops. I’m not sure about mobile solutions.
There are some example projects available on how to make a sound engine with objective-c. Apple even gives you one with x-code. But…
The iPhone’s flashdrive is very slow for loading content on the fly, so doing this could potentially be even slower than loading everything into memory beforehand.
Demand for good, flexible audio engines is definitely there, both for desktop and mobile platforms. This is why we discussed adapting an audio engine such as Pure Data for use with Unity. Doing this is no small feat though, so a solution of this kind is still a long way off.