DirectSound implementation in Delphi for sound recording/output classes
$30-250 USD
Cancelled
Posted almost 11 years ago
$30-250 USD
Paid on delivery
Write DirectSound interface for the listed below wrapper (sound playback/recording). For use in Delphi XE4. Objects should allow re-creation
(freeing an object and creating another copy should work without restrictions). Wave output (TAudioOutput) should work with default output device,
should support simultaneous playback (adding several buffers at the same time should result their mixing).
TAudioInput is should work with default system input device, and return recorded buffers via callback routine; the size of the buffer should be controlled at the time of initialization (in the code below through "chunk" parameter, or any other interface that allows to control the buffer size).
type
TAudioOutput = class
public
constructor Create(Hz:integer; Stereo:boolean; Is8Bit:boolean); //Is8Bit = if true the sound discretion is 8 bit
procedure AddBuffer(p:pointer; cbSize:integer); ;//p - buffer, cbSize - buffer size
destructor Destroy; override;
end;
TAudioCallbackRoutine = procedure (p:pointer; cbSize:integer);
TAudioInput = class
public
property CallBack:TAudioCallbackRoutine read FCallback write FCallback; //callback routine for the sound recording, called when an input buffer is full
constructor Create(Hz:integer; Stereo:boolean; Is8bit:boolean; ChunkSize:integer); //ChunkSize is a size of the input buffer
procedure Start;
procedure Pause;
procedure Stop;
destructor Destroy; override;
end;