Run Example files

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Run Example files

CatMasterDad
I just copied and pasted to my new lazarus project and got error stating

Compile Project, Target: project1.exe: Exit code 1, Errors: 1
test.pas(8,56) Fatal: Cannot find uos used by test of the Project Inspector.
Codetools, Errors: 1
test.pas(8,59) Error: unit not found: uos

anyone have a clue?

Reply | Threaded
Open this post in threaded view
|

Re: Run Example files

fredvs
Administrator
Hello CatMasterDad and welcome to uos forum.

Can you give the code of your test project?

In the project options, did you add the path of the directory of /uos/src/?
(usually -Fu/path_of/uos/src/)


If no, you may copy all the files that are in /uos/src/ in the same directory as your project.

Fred
Reply | Threaded
Open this post in threaded view
|

Re: Run Example files

CatMasterDad
here is the only change that I have made to the default form

procedure TForm1.FormCreate(Sender: TObject);
begin
 begin
  uos_LoadLib( PortAudioFileName, nil, Mpg123FileName,  nil, nil, nil);
  // only PortAudio and Mpg123 are needed.
  uos_CreatePlayer( 0 );            
  // you may create how many players you want, from 0 to to what you computer can do...
  uos_AddIntoDevOut( 0 );            
  // Add Output with default parameters
  uos_AddFromFile( 0, 'MySong.mp3' );
  // Input from audio file
  // And let's play it...
  uos_Play(0);                        // Play the song...
end;
...
uos_free;
end;


Reply | Threaded
Open this post in threaded view
|

Re: Run Example files

CatMasterDad
In reply to this post by fredvs
This all that is in the "Unit Output Directory (-FU)"
lib\$(TargetCPU)-$(TargetOS)

so now I just add

 -Fu/path_of/uos/src/

like
1. lib\$(TargetCPU)-$(TargetOS) -Fu/path_of/uos/src/
or
2. lib\$(TargetCPU)-$(TargetOS); -Fu/path_of/uos/src/
Reply | Threaded
Open this post in threaded view
|

Re: Run Example files

fredvs
Administrator
In reply to this post by CatMasterDad
Hello.

Hum, I am not sure that OPM has the last source of uos.

Imho, the easier way is to download the source from here:
https://github.com/fredvs/uos/archive/refs/heads/main.zip

And unzip it in a directory of your choice.

Then, run Lazarus and in menu Project/Open_Project and select /directory_of_/uos-main/examples/simpleplayer.lpi

Edit it, compile it and run it.
It should be out-of-the-box.

Fred

Reply | Threaded
Open this post in threaded view
|

Re: Run Example files

CatMasterDad
In reply to this post by fredvs
ok just finished a full path file search at the Lazarus root directory to full every subdirectory use
 search pattern "*/uos/src/*" with 0 results
OOPs that's not windows folder branches, more like Linux/Unix
try once more with "*\uos\src\*"
and same results
nothing found 0 results
to conclude windows search found no such listing of any sort \uos\src\
to me that is saying that in might not be installed correctly
Reply | Threaded
Open this post in threaded view
|

Re: Run Example files

CatMasterDad
In reply to this post by fredvs
Yes it did run but it show several paths but i'm not sure what to  do with it.
Reply | Threaded
Open this post in threaded view
|

Re: Run Example files

CatMasterDad
In reply to this post by fredvs
i figured it out and played a MP3 sounds good.
I can check out the inside of this code and paly around with it.
Thank you
This completes step one of my audio project
1[x] play a sound file
2[ ] record a sound file
3[ ] play midi
4[ ] play Text to Speech
5[ ] get mic to trigger an event
6[ ] activate voice recognition

Reply | Threaded
Open this post in threaded view
|

Re: Run Example files

CatMasterDad
You did mention of coping a directory.
I remember using Delphi 2006 enterprise with very much the same problems
so I created a directory called Global Units and put that in the directory search path. I remember I had to
be carful cause some time I would get the same name from different developers that would cause havoc.
Thank you again for all your help