Hottest Free Downloads - DownloadPipe.com Over 197,000 downloads! Bookmark Now!
DownloadPipe.com - New Downloads Every Minute
 SEARCH:
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

MTCoreAudio question

 
   Mac (Home) -> Programmer Help RSS
Next:  Template Syntax Error in Xcode: parse error befor..  
Author Message
pf

External


Since: Nov 27, 2005
Posts: 18



(Msg. 1) Posted: Fri Jan 20, 2006 1:03 am
Post subject: MTCoreAudio question
Archived from groups: comp>sys>mac>programmer>help (more info?)

Hi,

I'm using MTCoreAudio and need to record x seconds (say 5 seconds) of
audio into one buffer. I've got the sammple rate but how do I calculate
the buffer size?

One of the examples I found uses:-

// about 25 seconds of recording time
#define SOUND_BUFFER_SIZE (8 * 1024 * 1024)

But this is much longer than 25 seconds at what seems to be my computers
nominalSampleRate of 22050.

Thanks,

Paul
Back to top
Login to vote
Michael Ash

External


Since: Mar 21, 2006
Posts: 164



(Msg. 2) Posted: Fri Jan 20, 2006 1:03 am
Post subject: Re: MTCoreAudio question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

pf <paulfredlein.TakeThisOut@nospamoptusnet.com.au> wrote:
> Hi,
>
> I'm using MTCoreAudio and need to record x seconds (say 5 seconds) of
> audio into one buffer. I've got the sammple rate but how do I calculate
> the buffer size?
>
> One of the examples I found uses:-
>
> // about 25 seconds of recording time
> #define SOUND_BUFFER_SIZE (8 * 1024 * 1024)
>
> But this is much longer than 25 seconds at what seems to be my computers
> nominalSampleRate of 22050.

To get a buffer that is x seconds long, with a sample rate of r, a sample
size of s, and n channels, your buffer size would be:

size = x * r * s * n

So for 5 seconds at 22050Hz, 4-byte samples, and 2 channels, your buffer
size would be 5 * 22050 * 4 * 2 = 882000 bytes.

--
Michael Ash
Rogue Amoeba Software
Back to top
Login to vote
Display posts from previous:   
Related Topics:
MTCoreAudio on Intel; does it work? - Hi, My project is using MTCoreAudio and works OK on PPC but:- inputDevice = [MTCoreAudioDevice defaultInputDevice]; returns nil on my Intel iMac. Does MTCoreAudio work on Intel? Thanks, Paul

Question about NSTabView - HI I don't know if Gorm/Interface Builder questions are on topic in here, the FAQ doesn't seem to say. Anyway, I had an application working fine with its NSTableView (the delegate was my AppController class). I used Interface Builder to create a..

stringWithContentsOfFile question - Using stringWithContentsOfFile I can load an NSString with the contents of a file (obviously). What are the practical limits with regard to the size of file that could be handled? Jim -- Find me at http://www.ursaMinorBeta.co.uk My lucky star is..

One more C++ cout question - I have a hex value, 0x14000, and I want to output it as, 0x00014000. Is it possible to get this output using std::cout? Thanks

Novice question about NSButton - Hello, I have been working my way through developing my first Cocoa app, (a calculator, naturally) and have hit a bit of a wall toward the end. Apologies in advance for the long post. The problem: All my keys are straight NSButtons with a key..
       Mac (Home) -> Programmer Help All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum
Categories:
 Windows Forums
 Game Forums
 Linux Forums
  Mac Forums
 PDA Forums
 Mobile Forums
  Top  |  Store  |  RSS Feeds RSS  |  Data Feeds  |  Advertise  |  Submit  |  Bookmark  |  Newsletter  |  Contact