Hi All ,

Can anybody explain me how to use sndStreamCreate () ...

i want to play a wave file by using sndStreamCreate ()

first i am creating a file where i am storing the wave file data ...

that file handle i am passing to sndStreamCreate as callbackarg ...

in snd_callback i am reading the buffer from particular file ... basically i am trying tp play playback ...

but then it is not working ... why it is so ??? any can get sample program from palm site ???

Regards ,
Geeta M


here is the code
void call_snd_create()
{
Err err;
int ret = 0;
unsigned long len_to_read = 500,ret_len=0,len =0;
Byte *buf[300] = {0};

err = SndStreamCreate(&stream, sndOutput, 48000, sndInt16Big, sndStereo, snd_callback,file_h,250,false);
switch (err)
{
// generate error value;
}
if(SndStreamStop(stream)== errNone)
{
//FrmCustomAlert(ErrorAlert,"Success","In stopping the stream","**");
}
else FrmCustomAlert(ErrorAlert,"Failuer","In stopping the stream","**");
if(stream)
{
err = SndStreamStart (stream) ;
switch (err)
{
// generate error value }
}
else
{
FrmCustomAlert (ErrorAlert, "Stream not created", "**", "**") ; return ;
}
}

Err snd_callback (void *userData, SndStreamRef stream, void *buffer, UInt32 frameCount)
{
int read_len = 250;
frameCount = 2 ;
ret = ReadFile ((FileHand) userData, buffer, (DWORD) read_len, (unsigned long*)&ret_len, NULL) ;
if (ret == 0)
{
//FrmCustomAlert (ErrorAlert, "ReadFile error", NULL, NULL) ; //WinDrawChars("read Err", StrLen("read Err"),10,50); return;
}
return errNone ;
}







--
For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/

Reply via email to