2020-03-23 00:08:48

Hi,
so I was wondering if people have any recommendations for 3d audio in python? I thought of libaudioverse, but I want something that runs on both windows and Mac.
It doesn't have to run on both, but if it did it would be nice.

Ivan M. Soto.
Feel free to check out my work and services.
http://ims-productions.com

2020-03-23 00:18:42

To my knowledge this doesn't exist unless you want to fight OpenALSoft into working.

There's a reason I'm putting the effort in.

My Blog
Twitter: @ajhicks1992

2020-03-23 00:19:14

There's FMOD, but...

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2020-03-23 00:44:01

@3
Does FMod do proper aHRTF?  As far as I know it's just a lowpass filter for sounds behind the listener.

My Blog
Twitter: @ajhicks1992

2020-03-23 01:12:33

@4, ot built-in, no. You can use SteamAudio for HRTF though.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2020-03-23 02:48:14 (edited by magurp244 2020-03-23 03:10:56)

Try my [OpenAL PyLite v1.2] wrapper, comes with various examples, uses OpenAL Soft, and handles most functions like HRTF, EFX, recording, etc. Just finished cleaning up a few little bugs in it so it should be fine with Python 3.

-BrushTone v1.3.3: Accessible Paint Tool
-AudiMesh3D v1.0.0: Accessible 3D Model Viewer

2020-03-23 03:20:44 (edited by amerikranian 2020-03-23 03:22:11)

@magurp, doesn't it require to write your own encoder, though? I also remember me having issues where I could hear sources extremely far away, no matter what I did with the rolloff and max_distance factors. The stupid sound just refused to stop playing.
There is not an official wrapper for FMOD in Python. Most old ones use old versions of the library (1.0 I think) and don't work properly.
You may wish to try out soloud, Lucia's team was considering it earlier, though I don't know if it has 3d functionality.

2020-03-23 04:41:54

Encoder? Are you referring to recording audio, or loading various file formats? As for volume drop off, I do recall you had an issue with that. Running some tests with the 3D Audio example and changing the rolloff factor to 0.5 seems to mute the sound, but I do hear a faint remnant. Other than a question of sensitivity, the only other way to handle that would likely be to adjust whether the sound is playing based on distance or a volume cutoff value.

-BrushTone v1.3.3: Accessible Paint Tool
-AudiMesh3D v1.0.0: Accessible 3D Model Viewer

2020-03-23 05:11:27

Loading files, I thought the examples supported wave only. Not an issue, I just wanted to provide a clear picture. I am pretty sure you have posted a link to an already made encoder earlier, too.
I may have to give the examples another spin, then. Glad it wasn’t my personal issue.

2020-03-23 05:34:23

SoLoud does have 3D audio support. It doesn't have much FX though, and any language bindings do not allow you to write new FX.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2020-03-23 05:57:59

The examples by themselves can only handle wav format, yes. Though I have posted an example of loading vorbis files with PyOgg into an openal buffer [here], post 11.

-BrushTone v1.3.3: Accessible Paint Tool
-AudiMesh3D v1.0.0: Accessible 3D Model Viewer

2020-03-23 07:12:43

@7, SoLoud supports 3d, but as 10 said, you can't roll your own effects on other languages like for example python. because it's a wrapper around it's generated code.
you only can write effects for it in c++.

2020-03-23 12:10:13

Soloud does not support hrtf officially. I mean you might be able to get it via the openal Backend but you really don't want to use that specific backend as it's laggy and just doesn't worth it. Go with that miniaudio thing or another one that works on mac too, you can actually change the backends by checking the operating system after all.
Soloud is a good choice if you're not looking for hrtf, and the effects it provides for python suit audio games.

---
Co-founder of Sonorous Arts.
Check out Sonorous Arts on github: https://github.com/sonorous-arts/
my Discord: kianoosh.shakeri2#2988