https://linen.dev logo
FlxSound backend stuff
# lime
r
Moving this here since its sorta inbetween lime and flixel

https://cdn.discordapp.com/attachments/1105955811097853972/1105955992895758476/bfb340755fb03242283b001a98b8124d.png▾

alright so the handle source buffer was null for some reason
awesome
totally
sound time and length seem unrelated aswell

https://cdn.discordapp.com/attachments/1105955811097853972/1105956579876020355/220c632365b4f5ed637ccd17f65d83b2.png▾

but its certainly closer to the end of the sound than the beginning
since the actual time appears to be MUCH higher than the length
a
where is this?
will have a little poke around
r
function init in this file

https://cdn.discordapp.com/attachments/1105955811097853972/1105960339855650896/1383521eb8af92e8bfe617dc82c3a7e3.png▾

im just gonna try null checking the source for now, should work by logic, even if it doesnt explain why it happens

https://cdn.discordapp.com/attachments/1105955811097853972/1105960631888265236/75a819326f10feb1efe888f438e8f5c7.png▾

a
yeah really interesting that it happens at all
r
youd expect channel to just be null aswell
or flxsound
but no only the source for some reason
a
what are the steps to reproduce it? 1. have a sound playing 2. tab out of the window, so that audio pauses 3. unpause and it crashes?
r
huh okay null checking the source worked
wha tim doing is basically play flxsound on certain acount, for example key press, try to tab out very fast constantly while repeatedly playing sound until it crashes it will only crash if you try to access any object related to the __source property of channel
whether it be the handle or just the backend
for this to work you also need to make sure you try and access __source whenever the channel is assigned a new value
(hence the set__channel here)
personally ill count the problem as resolved since i got it to not crash anymore, so i can move on to the fx and filter stuff
which i didnt get to test out yet properly
i tested and set up gain already but to be fair thats just volume (and doesnt even work as an ALEffect its literally a source param)
though since i already set it up ill keep it
a
OK cool
the direct filter to aux slot is the only way I got it to work
and the shit thing there is you need to keep track of the ID of the filter manually
but I think that can be fixed in the lime bindings
Copy code
hx
var filter_id = 0;
AL.source3i(source, AL.AUXILIARY_SEND_FILTER, aux, 0, filter_id);
also need to test this further, I didn't try with a 2nd filter yet
r
how do you get the filter id though
@able-action-74275
its never publically exposed
at least not in the form of an ALFilter
and anything that isnt an ALFilter is unfortunately useless for us
my current filter implementation forces direct filters

https://cdn.discordapp.com/attachments/1105955811097853972/1105969520826396712/34c8ee3cb1c8f43d9d593738e0c19f30.png▾

unfortunately
a
I am presuming the first one you init is 0
2nd is 1
etc
need to test that
r
for what, wdym
if you do the send filter then yes you need to keep track of the send filter id you set
(what is 0 here has to be 1 for more filters)
i already accounted for that though

https://cdn.discordapp.com/attachments/1105955811097853972/1105969898011766804/3c27d5081d11f1d549bd3d3ed4acd627.png▾

a
Copy code
hx
// has id 0
var filter = AL.createFilter();

// has id 1
var nextFilter =  AL.createFilter();
is my guess
r
ohno i dont mean the filter ids
the ids the auxiliary slots are tied to
you need them for the AL.removeSend call on the ALSource object that youre manipulating
a
I expect it's the same situation but would need to test
r
ah alright
anyways thanks for your help, might try to get non-direct filters working whenever, for now this should do ig,, if you figure anything out feel free to let me know!!
a
I'll definitely let you know if I get something going
r
ighty
a
that part of lime is a bit... janky in areas
I think nobody really uses it
which is a shame
r
it is indeed a shame, and indeed nobody really uses it
like 3 months ago i looked at the AL class in total confusion
and up until recently didnt search up official openal docs
a
yeah it really needs the open al docs which are... mostly good but a bit fucking long
r
well i did but only haxe related ones, not getting its a sep lib and you dont really have any related stuff on github so you gotta live with tutorials from 2015 or smth and also change them up just a bit to work with haxe, personally pretty fun though once you get the gist
a
super fun I agree
r
shame that most programmers i know (from fnf, go on behead me im too lazy to start my own project but i swear i do cooler stuff than copy scripts from amateurs) are wayyy too lazy to ever try get into that sort of stuff
its been bugging me for months so im glad to have finally gotten somewhere with it
a
you've done well
a lot of stuff in haxe is lacking any useful documentation or samples
instead takes hours of experimenting
r
yuup but idk for me thats more or less the fun part of course having a very documented library is nice and all but figuring stuff out on your own over time and having it make sense after 3 hours of looking around feels a lot more rewarding, even if it aint for everybody (aka those that i feel arent as passionate about programming as a whole)
idk most people just want to get the code laid out for them and have it do something cool, which is the opposite of rewarding to me personally
a
this is true yeah
I find haxe can be quite addicting in that respect
r
definetly more than langs like c++
i mean i like c++ but its exhausting to work with