J
Jerry
HI,friends:
_I am sorry that my topic may be not supposed here,but,I like here and
just know few places in all groups._
I want to playback wave buffer on mac. in realtime.
so,I divide the buffer of a wave data into small parts for playback.
the problem is:
when I define PCM_FRAME_SIZE as the value 4096 or 4096 mutiplied by an
int.the playback routine "play" the wave buffer and I can hear the
sound.
but when other values were assigned to PCM_FRAME_SIZE,for example,
#define PCM_BUFFER_SIZE 400 //as below
the routine will be terminated by the system with signal 10,or
signal11.
Q:___Are there any contrains on Mac. of sound manager(concerned with
buffer)?___
---------------------------------------------------
p-codes for ref.
----------------------------------------------------
#define PCM_FRAME_SIZE 400
int i=0;
while(i not over buffer){
channelptr ch=nil;
sndlisthandle header;
memcpy(desBuf+PCM_FRAME_SIZE*i,srcBuf+PCM_FRAME_SIZE*i,sizeof
(char)*PCM_FRAME_SIZE);
//it's confirmed that srcBuf contains the real wav data,
//I got it using debuger.
setupsndheader(header...,...,...,...,PCM_FRAME_SIZE,&hdrlen);
sndnewchannel(&ch,false);
sndplay(ch,false);
disposechannel(ch,false);
disposehandle((handle)header);
i++;
}
_I am sorry that my topic may be not supposed here,but,I like here and
just know few places in all groups._
I want to playback wave buffer on mac. in realtime.
so,I divide the buffer of a wave data into small parts for playback.
the problem is:
when I define PCM_FRAME_SIZE as the value 4096 or 4096 mutiplied by an
int.the playback routine "play" the wave buffer and I can hear the
sound.
but when other values were assigned to PCM_FRAME_SIZE,for example,
#define PCM_BUFFER_SIZE 400 //as below
the routine will be terminated by the system with signal 10,or
signal11.
Q:___Are there any contrains on Mac. of sound manager(concerned with
buffer)?___
---------------------------------------------------
p-codes for ref.
----------------------------------------------------
#define PCM_FRAME_SIZE 400
int i=0;
while(i not over buffer){
channelptr ch=nil;
sndlisthandle header;
memcpy(desBuf+PCM_FRAME_SIZE*i,srcBuf+PCM_FRAME_SIZE*i,sizeof
(char)*PCM_FRAME_SIZE);
//it's confirmed that srcBuf contains the real wav data,
//I got it using debuger.
setupsndheader(header...,...,...,...,PCM_FRAME_SIZE,&hdrlen);
sndnewchannel(&ch,false);
sndplay(ch,false);
disposechannel(ch,false);
disposehandle((handle)header);
i++;
}