Forum > Audio and Video
Join wav files
KMagic:
I got 5 wav files. I want to join these files in different orders (eg: 1-2-3-4-5,4-3-1-2-5...) and play the sound each time I click a button without a window media appearing and without a long interval between the files. Does anyone know which audio component in Lazarus can help me with this? 8-)
skalogryz:
It doesn't ... sound... like you actually need to "join" files together and produce another wav file. Instead it ...sounds... like you want to play these files in the different order.
If playback (in an arbitrary order) is the only task you need to do, then you could use "openal" package that uses openal library. Pretty cross-platform solution (if that matters).
The "joining" is achieved by feeding the sound-buffer by a proper wav file.
There's a very basic example given at openal package, that reads "uncompressed" wav file and plays it. See fpc/packages/openal/examples/wavopenal.pas
At the procedure alPlay (at the example file) you'll see that a wave buffer is being read from .wav file and then pushed to the sounds buffer (by calling alBufferData and alSourceQueueBuffer).
So that's the place you'd like to change. Once one file is read completely, you'd need to start the next file and keep feeding the buffer from it... and so on...
...sounds... easy, right?
KMagic:
Where can I find the tutorials for openAL for Lazarus?
skalogryz:
Try online! Google.com is awesome for the search purposes.
This one should work: http://www.noeska.com/doal/tutorials.aspx ... but look here too: http://comments.gmane.org/gmane.comp.ide.lazarus.general/50954
KMagic:
I had read the tutorials in noeska.com. However, for lesson 1, when I downloaded the sample code and compliled, there was an error. Program cannot find the unit al,altypes and alut. Why are there these units but not openAL?
Navigation
[0] Message Index
[#] Next page