Administrator
|
This post was updated on .
Hello and welcome to uos forum.
You may use something like this (not tested):
The main method ( see in other demos for the directory of library and variables)
-----------------
uos_LoadLib(nil, PChar(SndFileFileName), nil, nil, nil, nil); // only SndFile is needed
uos_CreatePlayer(PlayerIndex1);
InputIndex1 := uos_AddFromFile(PlayerIndex1, path-of-recorded-file);
uos_InputSetLevelEnable(PlayerIndex1, InputIndex1, 2);
uos_InputSetPositionEnable(PlayerIndex1, InputIndex1, 1);
uos_LoopProcIn(PlayerIndex1, InputIndex1, @LoopProcPlayer1); // this to seek begin of sound
uos_Play(PlayerIndex1);
-------------
The loop procedure:
procedure Tform1.LoopProcPlayer1; ///this to seek begin of sound
var
volumeLR : cfloat;
temptime: ttime;
ho, mi, se, ms: word;
thetime: string; // the value you will use for your text
begin
volumeLR := (uos_InputGetLevelLeft(PlayerIndex1, InputIndex1) +
uos_InputGetLevelRight(PlayerIndex1, InputIndex1)) / 2;
if volumeLR > 0.2 then // you need to test/adjust the value
begin
temptime := uos_InputPositionTime(PlayerIndex1, InputIndex1);
DecodeTime(temptime, ho, mi, se, ms);
thetime := format('%.2d:%.2d:%.2d.%.3d', [ho, mi, se, ms]); // here the time of begin of sound that you will use in text file
uos_Stop(PlayerIndex1);
end;
|