• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Recording to file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Recording to file


  • Subject: Re: Recording to file
  • From: john <email@hidden>
  • Date: Fri, 5 Jul 2002 21:23:48 +0000

Hi Paul,

You probably need to convert your data to 16 bit (by multiplying the data by 32767.0) and then endian swap it.

If this helps, what I have done is set up an audio buffer object encapsulating an NSMutableData member of a predefined size. In the IOProc it just adds the data to the buffer as it comes in. Once it reaches halfway, the IOProc starts a thread to write the lower half of the buffer to disk. When the IOProc reaches the end of the buffer, it starts over at the beginning of it and starts a thread to write the upper half to disk. Also in the audio buffer class, I set up a method that converts the audio data to 16 bit, swaps the bytes for endian, and returns the data in an NSData object. On a side note, I also use the Cocoa APIs for disk operations instead of the UNIX ones.

-- John


Hi All,

I'm using a superset of the below code to test recording to a file from line in.

I've then tried several variations of command line options to both lame and sox to try to get a file that sounds normal with no luck. The closest sounding is the following options to lame
lame -f --bitwidth 32 -m s -s 44.1 test.raw test.mp3

I think/hope I'm missing something simple and easy to fix. Can anyone point out whatever I'm doing wrong? Or even some sample code that records to file.
---
Paul Haddad (email@hidden) AIM:(ETS Paul)
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.

References: 
 >Recording to file (From: Paul Haddad <email@hidden>)

  • Prev by Date: Re: Reading audio being sent to output device
  • Next by Date: Emilie Autumn @ MyMac.com
  • Previous by thread: Re: Recording to file
  • Next by thread: Clock Sources
  • Index(es):
    • Date
    • Thread