[chuck-users] Conversion float to int using SndBuf

Mícheál Ó Catháin micheal.ocathain at gmail.com
Tue Jan 21 08:08:02 EST 2020


Hi
What is the best way to convert a float to int in the following please?

//I want to set myBuf.pos to a percentage of myBuf.samples()...
//Start playing at say 40% through the total number of samples.

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20200121/6b83ba90/attachment.html>


More information about the chuck-users mailing list