INTRODUCCIÓN SOBRE LA TDX_SOUND_LIBRARY
Top Next
La TDx_Sound_Library es una librería de 17 Componentes
para el Borland C++ Builder (BCB) rapid application development
(RAD) que mapean todas las funcionalidades de DirectSound(tm)
en componentes fáciles de utilizar de la VCL del BCB ,
suministrando un completo entorno de trabajo para sacar el máximo
rendimiento a DirectSound(tm) y Borland C++ Builder.
Estos componentes hacen que programar DirectSound(tm) sea muy
sencillo, haciendo trabajar DirectSound(tm) con Borland C++ Builder,
con algunas extras añadidos para mezclar DirectSound(tm)
y Borland C++ Builder - rápida y facilmente.
Todos los componentes vienen con código fuente completo,
archivos del proyecto, auto-instalador, Completa ayuda sensible
al contexto mediante la tecla [F1] que cubre todos los aspectos
de programación DirectSound(tm) además de algunas
características que hemos añadido, asi como demos
y código fuente de ejemplo.
Estos componentes sirven para la reproducción y grabación
de sonidos. Te permiten:-
- Reproducir varios efectos de sonido simultáneamente
- Reproducir Música
- Reproducir Sonidos 3D (posicionamiento en 3 dimensiones)
- Grabar Sonidos
- Grabar Música
- Reproducir todos los sonidos simultáneamente
- Reproducir sonidos por alguno o por todos los dispositivos
hardware
Para una perfecta actuación del engine de DirectSound(tm)
, la TDx_Sound_Library provee de:-
- Mezclado de datos de sonido en tiempo real
- Modificación de datos de sonido en tiempo real
- Control en tiempo real de la reproducción & grabación:
volumen, balance and frequencia
- Un nuevo paradigma en la programación, rapid application
development DirectSound, o "RAD DirectX" abreviado.
La TDx_Sound_Library contiene muchas funcionalidades añadidas,
diseñadas para facilitarte la vida , incluyendo :-
- Plenamente optimizado para BCB y la VCL
- Es la solución a los problemas de integración
de BCB y DirectX cuando sea necesario.
- Detección y Redirección automática de
errores a sencillos eventos del tipo OnError() .
- Manejo automático de "CallBack" y redirección
a eventos del tipo OnEnum...() .
- Manejo automático de eventos de Win32 y redirección
a sencillos eventos del tipo OnNotify() .
- Sencillo manejo de Recursos con funciones del tipo CreateFrom...(),
LoadFrom...() and SaveTo...() .
- Baja Latencia (delay) al empezar la reproducción o
grabación, tambien para todos los procesos de mapeado
(wrapping processes).
Para más información pulsa:-
Para información sobre la librería completa pulsa:-
DESARROLLO RÁPIDO DE APLICACIONES DIRECTSOUND
Top Next
Prev
Los componentes de la TDx_Sound_Library estan disponibles para
arrastrar y soltar visualmente, creando con ello una aplicación
que usa DirectSound.
Veamos un ejemplo, para crear una aplicación funcional de
DirectSound , usaremos una Ficha (Form) standar de BCBx .
Entonces añadiremos: 1 x TButton, 1 x TDx_Sound, 1 x TDx_SoundBuffer
and 1 x TDSBufferDesc :-
A continuación, procedemos a introducir un pequeño
código en nuestra aplicación:-
// ------------------------------------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
// creamos el interface al dispositivo DirectSound
por defecto
if (Dx_Sound1->Create(NULL))
 {
// creamos un DirectSoundBuffer
desde un fichero .wav
// y almacenamos la información
en DSBufferDesc1
if (Dx_SoundBuffer1->CreateFromFile("TEST.WAV", DSBufferDesc1,
Dx_Sound1))
{
// reproducimos el
fichero .wav una vez
if (Dx_SoundBuffer1->Play(0,0))
{
// mientras
siga sonando, podemos llamar a alguna función
while (Dx_SoundBuffer1->Playing)
DoSomething();
}
// destruimos el buffer
de sonido
Dx_SoundBuffer1->Destroy();
}
 // destruimos el DirectSound interface
 Dx_Sound1->Destroy();
 }
}
Ahora pulsa F9 para construir el proyecto: Tenemos una aplicación
DirectSound(tm) que reproduce un fichero llamado TEST.WAV
Esto es RAD DirectSound en acción.
Para más información pulsa:-
DETALLES DE LA TDX_SOUND_LIBRARY
Top Next
Prev
Los 17 Componentes de la TDx_Sound_Library :-
- suministran soporte avanzado de sonido en tus aplicaciones
de BCB
- Manejan automáticamente todo lo relacionado con DirectSound(tm)
- Es una solución elegante- hacen que DirectSound(tm)
trabaje muy bien con el BCB
- Suministran un juego de herramientas muy fáciles de
usar, diseñadas para eliminar la mayoría del trabajo
duro de programación DirectSound(tm)
- Te permiten utilizar DirectSound(tm) fácilmente. pudiendote
centrar en el lado creativo de la aplicación, mas que
en entender la tecnología del SDK
También suministran muchas funcionalidades añadidas,
como:-
- auto creación simple de buffers de sonido partiendo
de ficheros .wav
- cross-updating automático de los datasets relevantes
- traducción de callback a sencillos eventos del tipo
OnAAA()
- traducción automática de notificaciones del
sonido a sencillos eventos del tipo OnNotify()
Básicamente, todo lo requerido para programar aplicaciones
DirectSound(tm) es tarea sencilla en Borland C++ Builder.
Cuando comiences a usar los componentes, puedes ignorar la mayoría
de las capacidades avanzadas de DirectSound's y obtener resultados
de calidad en minutos, Cuando te hayas familiarizado con los componentes,
podrás experimentar con características avanzadas.
Tienes completo acceso a las interioridades de los componentes,
esto significa que puedes mezclar con código "normal" de
DirectSound(tm) si lo deseas.
En Resumen, la TDx_Sound_Library lo tiene todo para añadir
reproducción y grabación de sonidos con calidad profesional..
La TDx_Sound_Library ofrece :-
- Un manejo simple de todo lo relacionado con DirectSound(tm)
- Acceso simple a todas las funcionalidades de DirectSound(tm)
- Creación automática, destrucción y mantenimiento
de los interfaces de DirectSound(tm)
- Creación automática de sound buffers desde archivos
.wav
- Creación automática de archivos .wav desde los
sound buffers
- Automatic sound streaming features
- Fácil acceso a los datos del sonido
- Fácil acceso a la información del formato del
sonido
- Fácil almacenamiento de datos, estático o dinámico
- Easy byte-perfect sound buffer event notification
- Fácil manipulación del sonido y de los buffers
de captura de sonido
- Fácil acceso a todos los dispositivos de Reproducción
y Grabación
- Ayuda sensible al contexto en el BCB [ pulsando la tecla F1
en el BCB ]
Para más información, pulsa:-
COMPONENTES DE LA TDX_SOUND_LIBRARY
Top Next
Prev
La siguiente tabla contiene detalles sobre cada componente de
la TDx_Sound_Library, tambien contiene enlaces a páginas
de información individuales (La ayuda sensible al contexto
en el BCB está disponible a través de la tecla F1)
:-
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
A lo largo del tiempo hemos publicado mucha información
sobre la TDx_Sound_Library.
Actualmente, la siguiente tabla muestra el estado actual de la
TDx_Library, asi como enlaces a diversa información:-
|