Welcome, Guest
Username: Password: Remember me
General discussions, feature requests for CodeTyphon Project and discussions that don't fit in any of the other specific CodeTyphon forum categories.
  • Page:
  • 1

TOPIC:

How To PLAY a sound wav or mp3 in my Project?? 8 years 4 months ago #9767

  • lestroso
  • lestroso's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 50
  • Thank you received: 0
Hi to everybody,

is there a simple manner to play a sound once or when i want??

I have already seen all the Ocean example... but they are too complicated!!!

A simple manner?? a simple Library?? Any Idea??

Thanks A lot,

lestroso :blush:

Please Log in or Create an account to join the conversation.

How To PLAY a sound wav or mp3 in my Project?? 8 years 4 months ago #9772

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4535
  • Thank you received: 1114
Sir
my suggestion is pl_OpenALS library of CodeTyphon Studio
CodeOcean has samples and all runtime libraries
codetyphon\CodeOcean\0_libraries
PilotLogic Architect and Core Programmer
The following user(s) said Thank You: lestroso

Please Log in or Create an account to join the conversation.

Last edit: by Sternas Stefanos.

How To PLAY a sound wav or mp3 in my Project?? 8 years 4 months ago #9773

  • lestroso
  • lestroso's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 50
  • Thank you received: 0
Thanks a lot Sternas.....I'll take a look!!! Best regards,

Lestroso :woohoo:

Please Log in or Create an account to join the conversation.

How To PLAY a sound wav or mp3 in my Project?? 8 years 4 months ago #9775

  • Fred
  • Fred's Avatar
  • Visitor
  • Visitor
Hello.

There is also uos (github.com/fredvs/uos).

Libraries for Windows, Linux, RPI, FreeBSD, OSX are included.
Examples for LCL, fpGUI, MSE and console are included too. (working out of the box).

Sadly the pl_UOS library included in Code Typhon is out of date (use, please, last commits of github.com/fredvs/uos)

PS: @ Sternas, you are welcome, when you have time, to commit the (lot of) changes from uos-GitHub. :blush:

Fre;D

Please Log in or Create an account to join the conversation.

Last edit: by Fred.

How To PLAY a sound wav or mp3 in my Project?? 8 years 4 months ago #9777

  • lestroso
  • lestroso's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 50
  • Thank you received: 0
Dear Fred,

I thank you so much!!!! I appriciate a lot your answer!!! I 'll take a look.. i hope will easy to use...Thanks a lot again,

Lestroso :woohoo:

Please Log in or Create an account to join the conversation.

How To PLAY a sound wav or mp3 in my Project?? 8 years 4 months ago #9778

  • lestroso
  • lestroso's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 50
  • Thank you received: 0
Dear friend, i have found a way very easy to play a sound but only in windows,,..works also well in windows10!!!!
Best regards,
lestroso :woohoo:
Playing Sounds
Windows only: using the Windows API

You can use the Windows API to play e.g. wav files:

...
uses MMSystem;
...
sndPlaySound('C:\sounds\test.wav', snd_Async or snd_NoDefault);

The fail-safe way, which will allow appending paths and nonlatin file names is:

sndPlaySound(pchar(UTF8ToSys('C:\sounds\test.wav')), snd_Async or snd_NoDefault);

This works very fine in Typhon!!!!! Cheers, Lestroso :woohoo:

Please Log in or Create an account to join the conversation.

Last edit: by lestroso.

How To PLAY a sound wav or mp3 in my Project?? 8 years 4 months ago #9779

  • Fred
  • Fred's Avatar
  • Visitor
  • Visitor
@ lestroso : Nice but you will not be able to change volume, nor do a seek, nor apply DSP effect, nor have view meters, ...

Fre;D

Please Log in or Create an account to join the conversation.

How To PLAY a sound wav or mp3 in my Project?? 8 years 4 months ago #9780

  • lestroso
  • lestroso's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 50
  • Thank you received: 0
Hi Fred,

it's complicated your library....and there're no instructions how to use it. Also webplayer go for me in Crash!!!

In any case thanks a lot...

best regards,

lestroso :woohoo:

Please Log in or Create an account to join the conversation.

How To PLAY a sound wav or mp3 in my Project?? 8 years 4 months ago #9781

  • Fred
  • Fred's Avatar
  • Visitor
  • Visitor
Hello.

it's complicated your library....and there're no instructions how to use it.


In the Code-Typhon forum : www.pilotlogic.com/sitejoom/index.php/fo...-version-1-0-is-here

Also in the wiki : wiki.freepascal.org/uos

But the best instructions are in the comments of uos.pas code and in examples.


Also webplayer go for me in Crash!!!


With what os (Windows/Linux/osx) ? When do it crash ?

Fre;D

Please Log in or Create an account to join the conversation.

How To PLAY a sound wav or mp3 in my Project?? 8 years 4 months ago #9782

  • lestroso
  • lestroso's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 50
  • Thank you received: 0
Hi Fred!!

Thanks for theinstructions links...i'll see them as soon as possible....

Well webplayer crash.. i don't know why...when i push button to play...Crash..... I'm using WINDOW10 and HP PAVILLON G SERIES 4 gb ram corei5 64bit.
One question Fred... Is it possible with your library enclose a sound in the final exe??? without loading external data folder???

Best Regards,

Lestroso :lol:

Please Log in or Create an account to join the conversation.

Last edit: by lestroso.

How To PLAY a sound wav or mp3 in my Project?? 8 years 4 months ago #9783

  • Fred
  • Fred's Avatar
  • Visitor
  • Visitor

Well webplayer crash.. i don't know why...when i push button to play...Crash..... I'm using WINDOW10 and HP PAVILLON G SERIES 4 gb ram corei5 64bit.


Oooops, I just tested it with Windows 10 and, indeed, it crash. :(
I will fix it asap (aaargh, sure new pseudo-protection done by Microsoft for web-access ).
The good news is that webplayer tested on last Linux and FreeBSD is working ok.


Is it possible with your library enclose a sound in the final exe??? without loading external data folder???

If you store your audio-file into resource (.res) and compile it with the exe => of course it is possible.

Fre;D

Please Log in or Create an account to join the conversation.

Last edit: by Fred.

How To PLAY a sound wav or mp3 in my Project?? 8 years 4 months ago #9786

  • Fred
  • Fred's Avatar
  • Visitor
  • Visitor

lestroso wrote: Hi Fred!!
Well webplayer crash...
Lestroso :lol:


Hello.

OK, fixed in last release (github.com/fredvs/uos)

Many thanks to note it.

Fre;D

Please Log in or Create an account to join the conversation.

How To PLAY a sound wav or mp3 in my Project?? 8 years 4 months ago #9787

  • lestroso
  • lestroso's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 50
  • Thank you received: 0
Your welcome Fred....Thanks again a lot...

but do you know how to enclose sound as resource in .rsc file in typhon?? Thanks Fred....

Bye

Lestroso :(

Please Log in or Create an account to join the conversation.

How To PLAY a sound wav or mp3 in my Project?? 8 years 4 months ago #9788

  • Fred
  • Fred's Avatar
  • Visitor
  • Visitor

lestroso wrote: but do you know how to enclose sound as resource in .rsc file in typhon??
Lestroso :(



wiki.freepascal.org/Lazarus_Resources

Fre;D

Please Log in or Create an account to join the conversation.

Last edit: by Fred.
  • Page:
  • 1