By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,723 Members | 828 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,723 IT Pros & Developers. It's quick & easy.

playback wav buffer on Mac.

P: n/a
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_SI ZE*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_SIZ E,&hdrlen);
sndnewchannel(&ch,false);
sndplay(ch,false);
disposechannel(ch,false);
disposehandle((handle)header);
i++;
}

Nov 14 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Jerry wrote:
_I am sorry that my topic may be not supposed here, but I like here
and just know few places in all groups._


Just when you thought September had finally ended... Damn you Google!

<sigh>
Nov 14 '05 #2

P: n/a
"Jerry" <zi****@gmail.com> writes:
[...]
Q:___Are there any contrains on Mac. of sound manager(concerned with
buffer)?___


We have no idea. There are a number of comp.sys.mac.* newsgroups; try
one of them.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 14 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.