Using Juce for 3D Sound


#1

Hi!

I´m new on Juce, and i´m evaluating if it´s possible with it create a 3D API for me to use in Game projects.

In fact, i dont need the most of modules inside of Juce, like OpenGL , GUI and etc...The only thing i need is the modules related to Load/Stream Audio and alter it´s properties(And this is where my problem are located).

Simply, all other audio SDK´s that i found or have only stream 3D Audio, but not in Open Source Model, and the one´s that have, not have the funtionalities for example to Pan(Left/Right) and change the Treble or Low of the sound, only play it and change the volume...

To make possible i create a 3D Sound i need change the sound properties based on the 3D Positions and Objects that i already have in my software.

I already get all the code in a static library on my project and compile it Lovelly!

Juce fits perfectly with what my project need(OpenSource and Multiplatform) , and it will be great if i can produce 3D sound with it! ;)

Anyone can give me a little help informing if it´s possible change the sound properties with Juce, and if it´s possible give me a reeeaally simple example of how to Load and play a sound file or stream?

I load the Demos programs but all of them uses a lot of stuff , and i having some difficulties to identify only the classes and components i need...

Any help will be much appreciated!

Kind Regards.


#2

Hi,

Unfortunately I don't quite understand what you mean by "changing the sound properties",

but if you want to learn how to load and play a sound file in JUCE, I suggest you check out this tutorial:

http://learn.juce.com/doc/tutorial_playing_sound_files.php


#3

Hi William,

I think you are looking for something like OpenAL http://www.openal.org/. I used it in my thesis about auditory virtual environments.

Juce let's you write software that renders effects into audio streams. But it would be your job to define what it means, if an AudioSource is positioned at a certain point and directing towards another point in space. You would need to define panning, delays, equalization and reverberation. All these are involved (if not even more). When you have this already, you can also use juce to model these effects.

I hope this helps.

daniel

P.S. I am not a juce-pro, there might be more features, than I know yet.


#4

+1. JUCE does not have any features like that (3D sound positioning) at the moment


#5

Hi Daniel!

This is exactly what i´m looking for, how can i model this effects after i have a file and the system already loaded and playing my sound?

panning, delays, equalization and reverberation and etc?

 

Hi Timur,

I already try OpenAL , but i dont like...on my oppinion what i see in Juce are much much better!

I not want the 3D sound aready constructed, i want make my own using the funtionalities coded in Juce, and i only can do that if i can change things like panning , equalization of a sound in real-time.

All other stuff i already have implemented. ;)

Thanks so much for your prompt help!
I will check it out the tutorial first.

Kind Regards.


#6

"I not want the 3D sound aready constructed, i want make my own using the funtionalities coded in Juce, and i only can do that if i can change things like panning , equalization of a sound in real-time."

Juce doesn't have great facilities for doing even things like panning or EQ, you need to code all that yourself, or probably at least improve on what Juce has for those things. Juce isn't really much of a sound DSP library, it mostly has facilities for wiring up DSP code that you already have done (or will do) into audio hardware or plugin inputs/outputs. It also has lots of classes for doing GUIs.

What have you already coded for the sound processing?


#7

Hi Xenakios,

Yes, this is what i want, code my own sound processing routines and use what i have in Juce to help.

I not have anything coded yet about sound processing, only the 3D Code , Math etc..and now i will load and Play the sound using Juce.

Any Tip of how i can process , or tutorials that point me the right direction?

Looking at the structure i find in Juce Maybe create a DSP effect will be the way to implement this stuff?

 

Ha!

Sorry about my english...i write better in my native language... ;)

Kind Regards.


#8

I am not sure if Juce is the best option if it is games particularly you want to be doing.

Juce is mostly known for and oriented towards making "audio content creation" software. Juce's original developer Jules has for example created the Tracktion multitrack editing/mixing software. The Cycling74 company switched to using Juce for their modular MIDI/sound signal processing application Max/MSP. Then there are multiple developers who have used Juce to create plugins in the VST and similar formats. (Which are used inside applications like Tracktion, Cubase, Pro Tools or Reaper.)

I am not aware of any famous game that would have been developed using Juce. Certainly it is possible to do a game or maybe just its audio engine using Juce (since it's a quite powerful library), but it might not be the best approach, as more game oriented libraries/frameworks already exist. What has made you think Juce would be especially suitable for your purposes?


#9

Hi William,

panning, delays, equalization and reverberation and etc?

This is a question, which has no short answer. And here for Juce it's a little off-topic, as it is not juce's focus to do this. But I want to throw just a few names and concept which will help you to start the research:

Panning is the most easy task, which means you do some kind of reverse interpolation of the position of your sound source and adjust the gain in each speaker. This gives so called "virtual sound sources", which are perceived to be somewhere inbetween these speakers.

For the delay look up the "precedence effect" or "Haas-effect". It says that a sound seems to be originated from where the first waveform of the sound was perceived.

Equalization comes in place, when you adress the direction the sound was sent. As high frequencies are sent more direct than lower ones (very much simplified), they are diminuished when the source does not point towards the listener.

Reverberation means, that you have to add the diffuse reflections from the environment including equalization, decay and resonance to all the speakers.

This is btw. exactly the focus of OpenAL...

I hope you find some material, it's an interesting topic.

HTH, daniel


#10

Hi Xenakios,

My decision to use Juce is becouse it´s source code.

I simply create a library project, choose the modules i want and put it on My project compiling perfectly on My Open Source 3D game engine.

I try compile OpenAL , but the code are ugly , i try compile it as a static library and it was painfull, and there is no support, only a person that mantain the project alive...

I try another libraries like Fmod and Irrlich , but all of them only offers Dll´s to be loaded(And Cost a lot of money to have the source code) , and all my game Engine is Open Source and i give priority to SDK´s and API´s that are OpenSource too.

I Like Irrlich by their simplicity but are not OpenSource....

I Find out a SDK called YSE too, that uses Juce AND have 3D Sound funtionalities, but again, have a lot of stuff inside and i need evaluate this solution too.

My project is Called Insane Engine 3D (http://www.insaneengine3d.com.br) , and it are only in portuguese yet , but it are totally in C++ Open Source including IA and Physics, Math , etc...all of them entirelly coded by me.

I use this engine to teach 3D Engine Programming ,C++ Programming and 3D Programming with OpenGL and Mobile Game Programming at University, so i need show to the students the details of how to code this things and not only show to them how to Use a finished solution.

Thanks so much for your help, i will start test initially how to Open and Play the sound Files , and them start to work with the Sound Buffers, becouse i believe we can treat them as a texture in 3D (A buffer) where we can make changes during the streaming.

I use Qt to compile the system in Multiple Platforms , but Qt have the same situation(I can Play Load and change sound streams) but not know yet how can i change this stream in real time to create the 3D effect.

I will check it out again OpenAL , but just for reference since i try compile the source code with mine code and the things became terrible... kkkk

Thanks so much for your help!
If i progress with it i will let everyone know about it ok?

Kind Regards.