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::Play() ]
[ next: ReadFromStream() ]
[ prev: OpenStream() ]
public:
virtual bool __fastcall Play( dword pPriority, dword pFlags );
TDX_SOUNDBUFFER::PLAY()
[ component method ]
- Description
The
TDx_SoundBuffer::Play
method
will
cause
the
sound
buffer
to
play
from
the
current
position
of
the
play
cursor.
Calling
this
method
will
succeed,
but
no
sound
will
be
produced
unless
a
cooperative
level
has
been
set
using
TDx_Sound::SetCooperativeLevel().
A
secondary
buffer
being
played
when
there
is
no
primary
buffer
will
cause
the
primary
buffer
to
be
automatically
created
and
played.
Calling
this
method
when
the
buffer
is
already
playing
will
succeed,
playing
will
continue
using
the
flag
settings
defined
in
the
latest
call
to
this
method.
Calling
this
method
on
a
primary
buffer
will
cause
it
to
continue
playing
between
sounds,
thus
reducing
the
overhead
of
starting
and
stopping
play
and
potential
sound
artifacts
such
as
popping.
If
the
method
call
fails,
the
OnError
event
will
be
triggered
with
one
of
the
following
values:
DSERR_BUFFERLOST
DSERR_HWUNAVAIL
DSERR_INVALIDCALL
DSERR_INVALIDPARAM
DSERR_PRIOLEVELNEEDED
- Parameters
Priority
The Priority parameter defines the priority given to the sound being played.
This value may be used to decide which sound buffer is played using hardware resources when DSBPLAY_TERMINATEBY_PRIORITY is set in the Flags parameter of this method.
When DSBCAPS_ LOCDEFER is not set, this parameter must be 0.
Priorities range from 0 to ffffffff, with 0 having the lowest priory.
Flags
The Flags parameter defines a flag indicating how the buffer is to be played.
The described effect applies when the flag is set.
DSBPLAY_LOCHARDWARE
Play the sound using hardware only.
The buffer must have DSBCAPS_LOCDEFER set.
DSBPLAY_LOCSOFTWARE cannot be set in conjunction with this flag.
If no hardware voices are available and no DSBPLAY_TERMINATEBY_xxx flags set, the method call will fail.
When neither this flag or DBSPLAY_LOCSOFTWARE are set, the sound will be played using hardware or software, depending on resource availablility.
DSBPLAY_LOCSOFTWARE
Play the sound using software only.
The buffer must have DSBCAPS_LOCDEFER set.
The DSBPLAY_LOCHARDWARE and DSBPLAY_TERMINATEBY_xxx flags cannot be set in conjunction with this flag.
When neither this flag or DBSPLAY_LOCHARDWARE are set, the sound will be played using hardware or software, depending on resource availablility.
DSBPLAY_LOOPING
Play restarts from the beginning of the buffer whenever the end is reached.
Primary sound buffers must have this flag set.
DSBPLAY_TERMINATEBY_DISTANCE
If there are no hardware resources available, stop playing a 3D buffer that has DSBCAPS_MUTE3DATMAXDISTANCE set and is beyond its max distance and play this buffer instead.
If there are no 3D buffers meeting the requirements, the play will fail.
Only 3D buffers with DSBCAPS_LOCDEFER set may be terminated in this way.
DSBPLAY_TERMINATEBY_PRIORITY
If there are no hardware resources available, stop playing the buffer with the lowest priority and play this buffer instead.
A buffers priority is defined by the Priority parameter of this method and the play will fail if there are no hardware buffers with a lower priority than this one.
DSBPLAY_TERMINATEBY_DISTANCE cannot be set in conjunction with this flag.
Only buffers with DSBCAPS_LOCDEFER set may be terminated in this way.
DSBPLAY_TERMINATEBY_TIME
If there are no hardware resources available, stop playing the buffer with the least play time left and play this buffer instead.
Only buffers with DSBCAPS_LOCDEFER set may be terminated in this way.
- See Also
- Top
If you would like to submit additions or improvements to this page, click: darren_john_dwyer@hotmail.com.
|
|