|
TDX_SOUND_LIBRARY INFORMATION
|
|
If you would like to know more information about something not on this page, ask us and we'll add it to a page.
OVERVIEW OF THE TDX_SOUND_LIBRARY
Top
Next
The TDx_Sound_Library is a library of 17 Borland C++ Builder (BCB) rapid application development (RAD) components
that "wrap" all available DirectSound(tm) functionality into easy-to-use BCB Visual Component Library (VCL) components,
supplying a complete framework for harnessing all the power of DirectSound(tm) and Borland C++ Builder.
These components make DirectSound(tm) very easy to use, make DirectSound(tm) work with Borland C++ Builder,
have many added extras designed to help you mix DirectSound(tm) and Borland C++ Builder - quickly and easily.
All components come complete with full source code, project files, auto-installer, full [F1] context-sensitive help
covering all of DirectSound(tm) plus additional features, and demos with full source code.
These components talk to sound playback and recording devices, and they enable you to :-
- Play Many Sound Effects Simultaneously
- Play Music
- Play 3D Sounds
- Record Sounds
- Record Music
- Play all sounds simultaneously
- Play sounds using any or all hardware devices
By fully utilizing the underlying DirectSound(tm) engine, the TDx_Sound_Library supplies :-
- Realtime merging of sound data
- Realtime modification of sound data
- Realtime control of sound playback & recording: volume, balance and frequency
- A new programming paradigm, rapid application development DirectSound, or "RAD DirectX" for short.
The TDx_Sound_Library contains much added functionality designed to make your life significantly easier, including :-
- Fully optimized for BCB and the VCL
- A solution to integration problems between BCB and DirectX where necessary.
- Automatic error detection & redirection to easy-to-use OnError() events.
- Automatic callback handling & redirection to easy-to-use OnEnum...() events.
- Automatic win32 event handling & redirection to easy-to-use OnNotify() events.
- Simple resource management with fully integrated CreateFrom...(), LoadFrom...() and SaveTo...() functions.
- Low latency (delay) when starting playback or recording, and also for overall wrapping processes.
For more information, click :-
For background information on the entire TDx_Library, click :-
RAPID APPLICATON DEVELOPMENT DIRECTSOUND
Top
Next
Prev
The TDx_Sound_Library components are available to drag & drop to visually create a BCB application that uses DirectSound.
For example, to create a working DirectSound test application, use a standard BCB5 TForm.
Then add 1 x TButton, 1 x TDx_Sound, 1 x TDx_SoundBuffer and 1 x TDSBufferDesc :-
Add a little bit of code :-
// ------------------------------------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
// create an interface to the default DirectSound device
if (Dx_Sound1->Create(NULL))
 {
// create a DirectSoundBuffer from a .wav file
// and store the buffer information in DSBufferDesc1
if (Dx_SoundBuffer1->CreateFromFile("TEST.WAV", DSBufferDesc1, Dx_Sound1))
{
// play the .wav file once
if (Dx_SoundBuffer1->Play(0,0))
{
// do whatever you like until the sound stops playing
while (Dx_SoundBuffer1->Playing)
DoSomething();
}
// destroy the sound buffer
Dx_SoundBuffer1->Destroy();
}
 // destroy the DirectSound interface
 Dx_Sound1->Destroy();
 }
}
Press F9 to build the project: a DirectSound(tm) test application playing a file called TEST.WAV
RAD DirectSound in action.
For more information, click :-
DETAILS OF THE TDX_SOUND_LIBRARY
Top
Next
Prev
The 17 TDx_Sound_Library components :-
- supply advanced sound support to BCB applications
- automatically handle everything related to DirectSound(tm)
- are quite "smart" - they fully maintain everything required to make DirectSound(tm) work very well inside BCB
- supply an easy to use toolset designed to remove the vast majority of effort required to utilize DirectSound(tm)
- let you focus mostly on the creative side of using DirectSound(tm) rather than the underlying SDK technology
They supply much value-added functionality :-
- simple sound buffer auto-creation from .wav files
- automatic cross-updating of relevant datasets
- automatic callback translations to easy-to-use BCB OnAAA() events
- automatic sound notification translations to easy-to-use BCB OnNotify() events
Basically, everything required to make DirectSound(tm) incredibly easy to use with Borland C++ Builder.
When starting to use the components, you can ignore most of DirectSound's advanced capabilities and get quality results in minutes, then as you become familiar with the components and how they work, you can experiment with some of the more advanced features.
You have complete access to component internals, meaning you can mix & match with "normal" DirectSound(tm) code if you want.
Overall, the TDx_Sound_Library supplies everything required to add high-quality sound output and recording to any BCB application.
The TDx_Sound_Library offers :-
- Simple management of everything related to DirectSound(tm)
- Simple access to all available DirectSound(tm) functionality
- Automatic creation, destruction and maintenance of DirectSound(tm) interfaces
- Automatic creation of sound buffers from .wav files
- Automatic creation of .wav files from sound buffers
- Automatic sound streaming features
- Easy access to sound data
- Easy access to sound format information
- Easy static or dynamic sound data storage
- Easy byte-perfect sound buffer event notification
- Easy manipulation of sound and soundcapture buffers
- Easy access to all playback and recording devices
- Comprehensive BCB context-sensitive help [ press F1 in BCB ]
For more information, click :-
COMPONENTS OF THE TDX_SOUND_LIBRARY
Top
Next
Prev
The table below contains details on each TDx_Sound_Library component, and also contains links to individual reference pages ( context sensitive version is available within BCB at the press of the F1 key ) :-
COMPONENT LOGO |
COMPONENT NAME |
WRAPPER TYPE |
COMMENT |
|
TDS3DBuffer
|
Wrapper
|
The TDS3DBuffer component wraps a single DS3DBUFFER structure.
It describes the cone orientation,
cone outside volume,
inside cone angle,
max distance,
min distance,
mode,
outside cone angle,
position and
velocity,
of a 3D sound buffer.
|
|
TDS3DListener
|
Wrapper
|
The TDS3DListener component wraps a single DS3DLISTENER structure.
It describes the distance factor,
doppler factor,
front orientation,
top orientation,
position,
rolloff factor and
velocity
of a 3D sound listener.
|
|
TDSBCaps
|
Wrapper
|
The TDSBCaps component wraps a single DSBCAPS structure.
It describes the capabilities of a sound buffer including: buffer size,
general capabilities,
cpu overhead and
transfer rate.
|
|
TDSBPositionNotify
|
Multi - Wrapper
|
The TDSBPositionNotify component wraps and manages any number of DSBPOSITIONNOTIFY structures.
It is used to define an almost unlimited number of sound buffer notification positions (DirectSound seems to limit it to 60), which are byte-offsets inside a sound buffer.
Upon sound playback or recording, each time the play or
record cursor reaches the specified byte-offset, it will trigger an easy-to-use BCB event, either
TDx_SoundNotify::OnNotify() or
TDSBPositionNotify::OnNotify() depending on the setting of
the TDx_SoundNotify::LocalNotify property.
Advanced Tip:
This component interacts with TDx_SoundNotify and it's hidden class: TDx_SoundNotify_Thread.
Together, they translate difficult to implement win32 queued events generated by DirectSound(tm) into easy-to-use BCB events.
Overall, it's tight code, it creates minimal latency, it uses only one dynamic thread, an excellent result.
|
|
TDSBufferDesc
|
Wrapper
|
The TDSBufferDesc component wraps a single DSBUFFERDESC structure.
It describes characteristics of a sound buffer including it's
buffer size,
current settings and
format.
|
|
TDSCBCaps
|
Wrapper
|
The TDSCBCaps component wraps a single DSCBCAPS structure.
It describes the capabilities of a sound capture buffer, the
buffer size and
settings.
|
|
TDSCBufferDesc
|
Wrapper
|
The TDSCBufferDesc component wraps a single DSCBUFFERDESC structure.
It describes characteristics of a sound capture buffer including it's
buffer size,
current settings and
format.
|
|
TDSCaps
|
Wrapper
|
The TDSCaps component wraps a single DSCAPS structure.
It describes the capabilities of a particular directsound device, including it's
current functionality,
various memory settings,
sample rates,
mixing overheads,
total available hardware memory and.
hardware transfer rates.
|
|
TDSCCaps
|
Wrapper
|
The TDSCCaps component wraps a single DSCCAPS structure.
It describes the capabilities of a particular recording device, including the
number of hardware channels,
general capabilities and
recording formats.
|
|
TDx_Sound
|
Interface
|
The TDx_Sound component wraps and manages a single IDirectSound interface.
This is the main root component of the TDx_Sound_Library, everything else ultimately requires this component.
It supplies direct access to a particular DirectSound device interface, and is used to interact with a sound output device.
It can be used to
compact a sound buffer,
create a directsound interface,
create a sound buffer,
enumerate DirectSound(tm) devices,
destroy a directsound interface,
duplicate a sound buffer,
retrieve a device's capabilities,
set & retrieve a device's speaker configuration and
set & retrieve a device's cooperative level.
Additional functionality :-
OnCreate(), OnDestroy() and OnError() events triggered during creation, destruction, and whenever any error occurs.
A modified DSEnumerate() method which automatically calls the OnDSEnumerate() callback event.
An OnDSEnumerate() callback event which makes responding to device enumeration simple.
An internal method Internal_DSEnumerateCallback() which handles the DSEnumerate() to OnDSEnumerate() translation.
A Created property for determination of the internal interface creation status.
An ErrorValue property for determination of the last error result returned from DirectSound(tm) or the TDx_Sound_Library.
|
|
TDx_Sound3DBuffer
|
Interface
|
The TDx_Sound3DBuffer component wraps and manages a single IDirectSound3DBuffer interface.
It supplies direct access to a DirectSound3DBuffer interface, and is used to output 3D Sound Effects.
It can be used to
create a DirectSound3DBuffer interface,
destroy a DirectSound3DBuffer interface,
and set & retrieve:
all parameters,
cone angles,
cone orientation,
outside volume,
max distance,
min distance,
mode,
position and
velocity
for a 3D sound buffer.
Additional functionality:
OnCreate(), OnDestroy() and OnError() events triggered during creation, destruction, and whenever any error occurs.
A Created property for determination of the internal interface creation status.
An ErrorValue property for determination of the last error result returned from DirectSound(tm) or the TDx_Sound_Library.
|
|
TDx_Sound3DListener
|
Interface
|
The TDx_Sound3DListener component wraps and manages a single IDirectSound3DListener interface.
It supplies direct access to a DirectSound3DListener interface, which is used to modify 3D Sound Effect output into a position relative to the person listening to the output.
It can be used to
commit deferred settings,
create a DirectSound3DListener interface,
destroy a DirectSound3DListener interface,
and set & retrieve:
all parameters,
distance factor,
doppler factor,
orientation,
position,
rolloff factor and
velocity
for a person listening to the output of a 3D buffer, a 3D Sound Listener.
Additional functionality:
OnCreate(), OnDestroy() and OnError() events triggered during creation, destruction, and whenever any error occurs.
A Created property for determination of the internal interface creation status.
An ErrorValue property for determination of the last error result returned from DirectSound(tm) or the TDx_Sound_Library.
|
|
TDx_SoundBuffer
|
Interface
|
The TDx_SoundBuffer component wraps and manages a single IDirectSoundBuffer interface.
It supplies direct access to a DirectSoundBuffer interface, and is used to store sound data chunks.
It can be used to
create a DirectSoundBuffer interface,
destroy a DirectSoundBuffer interface,
retrieve the buffer's capabilities,
retrieve the buffer's current status,
lock a buffer and get access to it's raw sound data,
play a buffer,
restore a buffer that has been lost,
stop playing a buffer,
unlock a previously locked buffer,
it can be also be used to set & retrieve:
the buffers play cursor position,
the buffer's format,
the buffer's playback frequency,
the buffer's panning level,
the buffer's volume level,
built-in .wav file routines:
create a DirectSoundBuffer interface from an existing .wav file,
close a streaming .wav file,
open a streaming .wav file,
read sound data from a streaming .wav file,
save DirectSoundBuffer to a .wav file,
write sound data to a streaming .wav file,
Added functionality:
A Frequency property to simplify setting of the buffer's output frequency
A Pan property to simplify setting of the buffer's panning level
A Volume property to simplify setting of the buffer's volume level
A Playing property to determine whether the buffer is currently playing
A StreamFormat property used to access the raw .wav file format
A StreamIsOpen property to determine if the sound stream is currently open
A StreamSize property to determine the total size, in bytes of the open sound stream
OnCreate(), OnDestroy() and OnError() events triggered during creation, destruction, and whenever any error occurs.
A Created property for determination of the internal interface creation status.
An ErrorValue property for determination of the last error result returned from DirectSound(tm) or the TDx_Sound_Library.
A check for a DSERR_BUFFERLOST error is automatically built in to all TDx_DrawSurface method calls. When a surface is lost the OnBufferLost() event is triggered and a quick call the relevant buffer's ::Restore() method will restore a buffer as required.
|
|
TDx_SoundCapture
|
Interface
|
The TDx_SoundCapture component wraps and manages a single IDirectSoundCapture interface.
It supplies direct access to a DirectSoundCapture interface, and is used to interact with sound recording devices.
It can be used to
create a DirectSoundCapture interface,
create a DirectSoundCaptureBuffer,
enumerate recording devices,
destroy a DirectSoundCapture interface and
retrieve the recording device's capabilities.
Additional functionality :-
OnCreate(), OnDestroy() and OnError() events triggered during creation, destruction, and whenever any error occurs.
A modified DSCaptureEnumerate() method which automatically calls the OnDSCaptureEnumerate() callback event.
An OnDSCaptureEnumerate() callback event which makes responding to device enumeration simple.
An internal method Internal_DSCaptureEnumerateCallback() which handles the DSCaptureEnumerate() to OnDSCaptureEnumerate() translation.
A Created property for determination of the internal interface creation status.
An ErrorValue property for determination of the last error result returned from DirectSound(tm) or the TDx_Sound_Library.
|
|
TDx_SoundCaptureBuffer
|
Interface
|
The TDx_SoundCaptureBuffer component wraps and manages a single IDirectSoundCaptureBuffer interface.
It supplies direct access to a DirectSoundCaptureBuffer interface, and is used to store recorded sound data chunks.
It can be used to
create a DirectSoundBuffer interface,
destroy a DirectSoundBuffer interface,
retrieve the buffer's capabilities,
retrieve the buffers current recording cursor position,
retrieve the recording buffer's format,
retrieve the buffer's current status,
lock a buffer and get access to it's raw sound data,
start recording into the buffer,
stop recording into the buffer,
unlock a previously locked buffer,
built-in .wav file routines:
close a streaming .wav file,
create a streaming .wav file,
write sound data to a streaming .wav file,
save DirectSoundCaptureBuffer to a .wav file,
Added functionality:
A Recording property to determine whether the buffer is currently being recorded
A StreamFormat property used to access the raw .wav file format
A StreamIsOpen property to determine if the sound stream is currently open
A StreamSize property to determine the total size, in bytes of the open sound stream
OnCreate(), OnDestroy() and OnError() events triggered during creation, destruction, and whenever any error occurs.
A Created property for determination of the internal interface creation status.
An ErrorValue property for determination of the last error result returned from DirectSound(tm) or the TDx_Sound_Library.
|
|
TDx_SoundKsPropertySet
|
Interface
|
The TDx_SoundKsPropertySet component wraps and manages a single IKsPropertySet interface.
It supplies access to a KsPropertySet interface, and is used to access the extended capabilities of some sound devices.
It can be used to
create a KsPropertySet interface,
destroy a KsPropertySet interface,
return a value for a given property set,
query if a device supports a given property set,
set a value for a give property set,
Added functionality:
OnCreate(), OnDestroy() and OnError() events triggered during creation, destruction, and whenever any error occurs.
A Created property for determination of the internal interface creation status.
An ErrorValue property for determination of the last error result returned from DirectSound(tm) or the TDx_Sound_Library.
|
|
TDx_SoundNotify
|
Interface
|
The TDx_SoundNotify component wraps and manages a single IDirectSoundNotify interface.
This component translates all aspects of DirectSound's sound buffer event notifications into easy-to-use BCB equivalents.
It can be used to
create a DirectSoundNotify interface,
destroy a DirectSoundNotify interface and
set notification positions for a sound buffer or sound capture buffer.
Added functionality:
OnNotify() event triggered immediately the play or read cursor reaches byte offsets specified with TDx_SoundNotify::SetNotificationPositions().
OnCreate(), OnDestroy() and OnError() events triggered during creation, destruction, and whenever any error occurs.
A Created property for determination of the internal interface creation status.
An ErrorValue property for determination of the last error result returned from DirectSound(tm) or the TDx_Sound_Library.
Special Note:
This particular component makes life so easy...
On the surface, everything is neat and clean, but underneath it's very complex, part of the subtlety of the entire TDx_Library concept.
It contains a hidden thread, TDx_SoundNotify_Thread, which together with TDx_SoundNotify automatically manage all relevant win32 handles and event triggers, translating the relatively difficult to intercept win32 queued notification events generated by DirectX into very easy to use
TDx_SoundNotify::OnNotify() or TDSBPositionNotify::OnNotify() events, depending on the setting of the TDx_SoundNotify::LocalNotify property.
This is due to complex multithreaded translation routines mixed in with dynamic maintenance of everything including the thread itself.
It works, it's solid, transparent, causes minimal latency, and uses one thread.
Please enjoy the results of my 1.23 billion crashes and cold reboots ;)
|
MORE INFORMATION ABOUT THE TDX_SOUND_LIBRARY
Top
Prev
Over time we will add much more information about the TDx_Sound_Library.
In the meantime, the table below contains details on the current status of the entire TDx_Library, and links to more information :-
|
|