[quote="Rojekti"]Hmm, very interesting..!
Since my programmingskills arent so high, I didn't really get the point of this engine. But, I did get it working, played sounds, etc. It's gooo-ood. Plays them just well
But.. so.. emm. This code, which was found in the example;
Code:
// this initializes sound
VirtualOpenDevice(nil);
VirtualInitialize;
// this loads a SINGLE wave file into a wave buffer, you can load many sounds and have them shared by the sources (one loaded wav file can be played back several times at the same time)
setlength(WaveBuffers, length(WaveBuffers) +1);
with WaveBuffers[high(WaveBuffers)] do begin
ID:= indexx;
XALLoadWave(buffer, pchar(sound));
end;
// this sets up the listener's position (the player's location in the world)
VirtualModifyListener(makevector(0.0, 0.0, 0.0), makevector(0.0, 0.0, 0.0), virtualopenal.ListenerOrientationarray);
// this creates a single source
SourceCreate(WaveBuffers[FindBuffer(indexx)].buffer, makevector(0, 0, 0), true , nil , nil);
// this handles swapping sources in and out if there are too small amout of them in hardware to use all at the same time
VirtualSwapInSwapOut;
dofunstuff:= true; // fun variable :)
i commented what the pieces of code do ^^^^
..what it exactly does? Did I got it right: it creates a source of a sound? So, it wont just play a single sound, but it kinda creates a trigger which plays some sound, from a certain position? I should tell it where it is and where the listener is -> it calculates the volyme of sound..? Or am I dump?
well yeah, you load wav files into buffers, and you can pick a buffer and play it back in many places and many times, you can also set volume, pitch, velocity (doppler effect) and so on...
Bookmarks