Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2024-11

Play sound in Lazarus 3.4?

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Timothy Groves

I cannot find an acceptable answer to this anywhere online.? I've been looking for an hour.

How do I play back a wav file?

Preferably, how do I store a bunch of them, play them back as needed when called?

Reply by email

Kostas Michalopoulos
to Timothy Groves
Timothy Groves wrote 8 lines
I cannot find an acceptable answer to this anywhere online.? I've been looking for an hour. How do I play back a wav file? Preferably, how do I store a bunch of them, play them back as needed when called?

On Windows you could use PlaySound. There is no cross-platform high level audio support in FPC or Lazarus (fcl-sound could be a candidate but all it provides right now is reading WAV files, there is no support for audio playback).

You can use OpenAL as a cross-platform audio library. The OpenAL bindings for Free Pascal have an example of loading and playing WAV files directly in packages/examples/wavopenal.pas.

Reply by email

Timothy Groves
to Kostas Michalopoulos

Found an SDL solution.? Only problem is that I have to manually copy the SDL units into my project directory for any project that uses it...

Kostas Michalopoulos wrote 20 lines
On 11/22/24 8:12 PM, Timothy Groves via lazarus wrote: > I cannot find an acceptable answer to this anywhere online.? I've > been looking for an hour. > > How do I play back a wav file? > > Preferably, how do I store a bunch of them, play them back as needed > when called? > On Windows you could use PlaySound. There is no cross-platform high level audio support in FPC or Lazarus (fcl-sound could be a candidate but all it provides right now is reading WAV files, there is no support for audio playback). You can use OpenAL as a cross-platform audio library. The OpenAL bindings for Free Pascal have an example of loading and playing WAV files directly in packages/examples/wavopenal.pas.

Reply by email