simplest to play a wav file a la sndplaysound() ?

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

simplest to play a wav file a la sndplaysound() ?

myos
I have compiled and run the console demo and simpleplayer_noflat projects.   It seems to do the job nicely.

Now I want to integrate a minimal ammount of code into my project to initially just provide a Linux equivalent for the old sndplaysound() windows API.

If I add laz_uos it gets found OK, but this does not provide access to uos_LoadLib, uos_CreatePlayer, etc. I need to adapt the guts of the console project.

If I add uos_flat to my uses clause it is not found.

How can I use this in my project.   It looks very good.

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: simplest to play a wav file a la sndplaysound() ?

fredvs
Administrator
Hello.

Not sure to understand.

The demo  simpleplayer_noflat is to show how to use uos.pas unit in place of uos_flat.pas unit.
But in that case you have to create all the methods for creation, deletion, etc...

All the other demos use uos_flat that does all the job for you (creation of players, deletion of players, etc).
I highly recommend to use uos_flat.pas in place of only uos.pas ( or be sure what you do at creation of players).

Do you have problems to load-run the demos in /uos/examples/?

It should be out-of-the-box, just load a lpi project via Lazarus/Open Project an compile it.

But maybe I did not catch your problem, if so please explain.

Fre;

Reply | Threaded
Open this post in threaded view
|

Re: simplest to play a wav file a la sndplaysound() ?

fredvs
Administrator
This post was updated on .
Re-hello.

Imho, the most easy for beginning is to jump into the demos and analyze the code to understand how it works.

Then, If you want to create a project from scratch:

- Create a directory ( example c:/myuosproject )
- Paste into it all the units from /uos/src/.

- Create your project in that directory.
- In uses section of main form, add "uos_flat".

- Depend on the OS and what you use in your program, copy the libraries needed from /uos/examples/lib/ into, for example, c:/myuosproject/lib
- If you want to only play wav files, only PortAudio and SndFile libraries are needed.

- When using uos_loadlib() in your code, assign this path + name of the libraries  (see examples).

- Then add all the uos methods you need, taken inspiration from the uos-examples.

You may also customize uos to only use the methods you need editing uos_define.inc (But that is for later ;-) )