Welcome to
www.tdxlibrary.org
Home of the
the TDx_Library...
"RAD DirectX"
for
C++ Builder
...
|
TDx_Sound_Library v2.00 Component Reference
|
|
[ TDx_SoundBuffer::CreateFromFile() ]
[ next: CreateStream() ]
[ prev: Create() ]
public:
virtual bool __fastcall CreateFromFile( AnsiString pFileName, TDSBufferDesc* pBufferDesc, TDx_Sound* pSound );
TDX_SOUNDBUFFER::CREATEFROMFILE()
[ component method ]
- Description
The
CreateFromFile
method
will
create
a
sound
buffer
of
the
same
format
as
a
specified
.wav
file.
If
there
is
an
existing
buffer
for
this
component,
it
will
be
destroyed
before
the
new
one
is
created.
The
size
of
the
new
buffer
will
equal
that
of
the
file's
sound
data,
which
is
automatically
loaded
into
the
buffer.
The
internal
WAVEFORMATEX
structure
referenced
by
the
TDx_SoundBuffer::StreamFormat
property
will
automatically
be
filled
with
the
format
data
of
the
specified
.wav
file.
Note:
This
method
does
not
support
the
loading
of
.wav
files
where
the
format
of
the
.wav
file
being
loaded
is
not
the
raw,
uncompressed,
WAVE_FORMAT_PCM
.wav
file
standard
that
DirectSound
supports.
It
currently
supports
only
WAVE_FORMAT_PCM
files,
and
may
have
undetermined
results
if
used
with
non-WAVE_FORMAT_PCM
files.
If
the
method
call
fails,
the
OnError
event
will
be
triggered
with
one
of
the
following
values:
TDX_BADPARAMS
TDX_ERROR
- Parameters
FileName
The FileName parameter defines the path and filename of the .wav file which will be used to create the sound buffer.
BufferDesc
The BufferDesc parameter references a TDSBufferDesc component for holding the properties of the new buffer.
The TDSBufferDesc component will mostly be filled automatically from data contained in the .wav file.
If control options in addition to the DSBCAPS_GETCURRENTPOSITION2 are required, it is neccessary to set the desired flags in the TDSBufferDesc component manually before calling this method.
Sound
The Sound parameter references the existing TDx_Sound component for which the sound buffer is to be created.
- See Also
- Top
If you would like to submit additions or improvements to this page, click: darren_john_dwyer@hotmail.com.
|
|