21 Jan
2020
21 Jan
'20
12:24 p.m.
We also added Std.ftoi(x) to the language a while back (at 1.3.2.0). It’s much clearer to read, and more obvious as to what’s going on and why, than the casting notation. To round, just add 0.5 to x in the function arg. so:
Std.ftoi(0.4*myBuf.samples()+0.5) => myBuf.pos;
would set your play pointer to the 40% point in the sound buffer. Prc Sent from my iPhone
1. Conversion float to int using SndBuf (M?che?l ? Cath?in)
40.0 => float pctPosInit; pctPosInit/100*myBuf.samples() => myBuf.pos;
This throws the error argument types don't match. I'm not seeing how to convert the float to an int here. Thanks for your help!
Micheal