Re: Trixie trouble

Posted by Henk Pragt on
URL: http://uos-forum.108.s1.nabble.com/Trixie-trouble-tp1502p1504.html

Hi Fred,
thanks for your reply.
I am still not very familiar with the internal workings of UOS, but was happy to get my mixer to work with such ease, so kudos for your work. I will look into deviceinfo demo to see if there a simple way to refer to the other output devices by name, so that updates to the OS will not change the index number. Is the latency just a start delay?

The basics of my simple app is below. I noticed that the values in the uos_inputindex and uos_outputindex always remain 0. Is that normal?
thx, Henk
----------------------------------------------------------
const noof_sounds = 20;
 
var filename : array[1..noof_sounds] of string;
    volume   : array[1..noof_sounds] of real;

var uos_inputindex   : array[0..sounds] of integer;   // sound system handles
    uos_outputindex  : array[0..sounds] of integer;

begin // on formactivate:
  // .. load filenames and volumes from disk

  uos_LoadLib('system', 'system', nil, nil, nil, nil, nil);

  for snd := 1 to noof_sounds do
  begin
    if uos_CreatePlayer(snd) then
    begin
      uos_inputindex[snd]  := uos_AddFromFile(snd, pchar(filename[snd]), -1, 2, 8192);
      uos_outputindex[snd] := uos_AddIntoDevOut(snd, -1, 0.08, uos_InputGetSampleRate(snd, uos_inputindex[snd]), uos_InputGetChannels(snd, uos_inputindex[snd]), 0, 8192, -1);
      uos_InputAddDSPVolume(snd, uos_inputindex[snd], vol[snd], vol[snd]); // set left and right volume
    end;
  end;

  // on button click:
  for snd := 1 to noof_sounds do uos_PlayNoFree(player);