Ooops... sorry for giving you more desnecessary work to do... I had not yet realized the need to use uos_InputGetSampleRate and uos_InputGetChannels inside uos_AddIntoDevOut... They did the trick!
About uos_Play, I'm using at least 3 sounds being executed in same time (me and my neverending drum machine, remember, Fred? ahahaha)... It's a small delay, like a half second or less. I realized that when I press a key or button to play, it's not instantly executed (I achieved an "almost real time play" only when I used uos_PlayNoFree and uos_Pause before starts execution -- and, inside the loop, I call uos_PlayNoFree again and again). But we've talked about uos_PlayNoFree before... the out of sync effect when more than one sound is playing at the same time is the big problem.
Yeap, I've tried before. But there are two problems:
1) Beats sounds "choppy". You'll be noticed that the problem is FramesCount parameter. But it's hard to set: with small values, there are a cut in the end (beats should keep sounding); and, increasing the frames number, more out of sync occurs.
2) Still there are desynchronization moments with this method, mostly with small times between loops.
So far, for me at least, the best method is creating a player and execute it in each loop.
PS: In my tests, uos_free always crashes the executable (in windows 10 x64, with LCL gui).
Thanks a lot, Fred. But remember that creating a player in each loop works fine. The only thing is there are a bit delay before uos_Play first execution (and a musician would expect an "almost" realtime response when press or click to play.
PS: uos_PlayNoFree should be the definitive solution in this case, I guess... But will be necessary to find why desynchronism happens when using uos_InputSeek and uos_PlayNoFree if more sounds are executed together.
Something is wrong in the last commit (revision 169). Some sounds don't play anymore, and others are being cut off at the end (maybe a problem with framecount parameter). When I did a downgrade (revision 168), everything worked fine again.