Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SOUND DATATYPES

6 views
Skip to first unread message

Josep Rubiralta

unread,
May 29, 1997, 3:00:00 AM5/29/97
to

Hi!!

I have a little problem with datatypes: I don't know how to play a sound sample with datatypes. I have been testing without any result.

I tried with this source:

APTR obj;
struct Library *DataTypesBase;
DataTypesBase = OpenLibrary("datatypes.library",0);
obj = NewDTObject("ram:lolo",DTA_GroupID,GID_SOUND,TAG_DONE);
if (!obj) return;
DoDTMethod(obj,NULL,NULL,DTM_TRIGGER,0,STM_PLAY,TAG_DONE);
DisposeDTObject(obj);
CloseLibrary(DataTypesBase);

In Ram: i have a sample file called 'lolo'

If someone can help me, if it is posible with a working source example I will be very grateful O:-)
--

Greetings, Pep

====================================================================
____
AMIGA / / / HTTP: www.redestb.es/personal/multitaskers/
____ / / / *IRC: MetalGear or Pep*
\ \ \/ / / *E-mail: pep-mu...@redestb.es*
\ \/ / / *josepru...@geocities.com*
\/_/_/ SPANISH-CATALAN A.T.O. TRANSLATOR
Using Amiga 4000/040, 18Mb Ram, 1Gb HD, CyberVision64, VLAB, CD-ROM
====================================================================

--

Greetings, Pep

====================================================================
____
AMIGA / / / HTTP: www.redestb.es/personal/multitaskers/
____ / / /

Troels Walsted Hansen

unread,
May 30, 1997, 3:00:00 AM5/30/97
to

In article <338E0CB3.MD-0.1...@redestb.es>,
pep-mu...@redestb.es (Josep Rubiralta) wrote:

>I have a little problem with datatypes: I don't know how to play a sound
> sample with datatypes. I have been testing without any result.

>I tried with this source:

> APTR obj;
> struct Library *DataTypesBase;
> DataTypesBase = OpenLibrary("datatypes.library",0);
> obj = NewDTObject("ram:lolo",DTA_GroupID,GID_SOUND,TAG_DONE);
> if (!obj) return;
> DoDTMethod(obj,NULL,NULL,DTM_TRIGGER,0,STM_PLAY,TAG_DONE);
> DisposeDTObject(obj);
> CloseLibrary(DataTypesBase);

>In Ram: i have a sample file called 'lolo'

>If someone can help me, if it is posible with a working source example I will
>be very grateful O:-)

I haven't looked closely at your source, but it seems you have done the same
mistake I once did.. The sound is played asynch, so you are disposing your dt
obj before it gets a chance to make a sound.. Try inserting a Delay(xxx) after
the DoDTMethod() call.

T r o e l s W a l s t e d H a n s e n
tro...@stud.cs.uit.no - http://www.cs.uit.no/~troels


Jonathan Gapen

unread,
May 30, 1997, 3:00:00 AM5/30/97
to

In article <1140.7089...@stud.cs.uit.no>, Troels Walsted Hansen wrote:

>I haven't looked closely at your source, but it seems you have done the same
>mistake I once did.. The sound is played asynch, so you are disposing your dt
>obj before it gets a chance to make a sound.. Try inserting a Delay(xxx) after
>the DoDTMethod() call.

Or see http://www.execpc.com/~innuendo/amiga/os/datatypes/src/Playsound.c
to find out how to wait for the sound to finish. :-)

--
Jonathan Gapen <no spam, please>
Some lead. Others follow. I'm lost.

Tak Tang

unread,
Jun 2, 1997, 3:00:00 AM6/2/97
to

Josep Rubiralta <pep-mu...@redestb.es> writes:

>I have a little problem with datatypes: I don't know how to play a sound sample with datatypes. I have been testing without any result.

>I tried with this source:

> APTR obj;
> struct Library *DataTypesBase;
> DataTypesBase = OpenLibrary("datatypes.library",0);
> obj = NewDTObject("ram:lolo",DTA_GroupID,GID_SOUND,TAG_DONE);
> if (!obj) return;
> DoDTMethod(obj,NULL,NULL,DTM_TRIGGER,0,STM_PLAY,TAG_DONE);
> DisposeDTObject(obj);
> CloseLibrary(DataTypesBase);

Everything is correct except that DisposeDTObject causes the sound to
stop immediately. In NewDTObject, you need to tell it to signal you
when it has finished playing, and then do a Wait() on it.

obj = NewDTObject("ram:lolo",DTA_GroupID,GID_SOUND,SDTA_SignalTask,
(ULONG)FindTask(NULL),SDTA_SignalBit,(ULONG)SIGBREAKF_CTRL_D,
TAG_DONE);

if (NULL != obj)
{
/* Play the sound */
DoMethod(obj, DTM_TRIGGER, NULL, STM_PLAY, NULL);
Wait (SIGBREAKF_CTRL_D);

/* Get rid of the object */
DisposeDTObject (obj);
} /* if NewDTObject() suceeded */

I have just uploaded version 1.2 of my own sound datatype player to
aminet, as mus/play/PlayDT.lha.

Regards,

Tak


Gabriele Greco

unread,
Jun 3, 1997, 3:00:00 AM6/3/97
to

Hello Tak,
In a message dated 02 Jun 97 you wrote to All :

TT> obj = NewDTObject("ram:lolo",DTA_GroupID,GID_SOUND,SDTA_SignalTask,
TT> (ULONG)FindTask(NULL),SDTA_SignalBit,(ULONG)SIGBREAKF_CTRL_D,
TT> TAG_DONE);

SignalTask and SignalBit are V40+, so if you want to be compatible with 3.0 you
should ask datatype the length of the sound, open the timer.device, send a
timerequest as long as the sound and wait for it...

Ciao,
Gabry (ggr...@iol.it)


0 new messages