Hi all,

I started working on a sound player my games. I want to use DirectSound cause I used it in other project. I didn't made the sound in my other projects, so I have no clue on where to start for making a nice sound player.

From this point I only know that sound uses buffers and channel. You load a buffer and play it in one or more channels. And on the channels you can set the volume n stuff.

So what would be a good approach to create a sound player that uses channels and buffers combined with Doppler effects and all.

My first thought was to make something like this:

Code:
SoundBuffer = class
  Buffer: Buffer to direct sound;
  function CreateSound : returns a new sound
  function LoadFromFile(FileName: string): boolean;
 end

Sound = Class
  Buffer: Pointer to SoundBuffer;
  Position : Vector3;
  Speed : integer;
  Volume : integer
  Channel : integer; / read only!! tis is set by the "play" function
  
  procedure Play;
  procedure stop;
end
For now I want to use DirectSound.