I am using audio unit for audio playback. I have download the tone generator from http://cocoawithlove.com/2010/10/ios-tone-generator-introduction-to.html and try to play around with it. For some reason I need to use ulaw instead of linear PCM. Here is my audio format setup:
AudioStreamBasicDescription streamFormat;
streamFormat.mSampleRate = 8000;
streamFormat.mFormatID = kAudioFormatULaw;
streamFormat.mFormatFlags = 0;
streamFormat.mFramesPerPacket = 1;
streamFormat.mBytesPerFrame = 2;
streamFormat.mBytesPerPacket = streamFormat.mBytesPerFrame;
streamFormat.mChannelsPerFrame = 1;
streamFormat.mBitsPerChannel = 16;
When I run the sample code, I get a constant noise. Does anyone could help on this issue? Thanks a lot.