• 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: CoreAudio in Simulator Bug ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CoreAudio in Simulator Bug ?


  • Subject: Re: CoreAudio in Simulator Bug ?
  • From: William Stewart <email@hidden>
  • Date: Mon, 3 Nov 2008 12:44:50 -0800

kAudioQueueProperty_StreamDescription, // this constant is only available in iPhone OS

this is on the desktop as well.

Can you have a look at the aqrecord example (/Developer/Examples/ CoreAudio) and see if there is any difference there - that example works fine on the desktop and with suitable mods should be fine on the device as well

On Nov 1, 2008, at 12:26 PM, Mark's Studio wrote:

I am having a bit of trouble with coreAudio and i am not sure if it's me, CoreAudio, or maybe my developer setup there is wrong,
i am using the code below (taken from SpeakHere ) to setup an input AudioQueue and everything seems to be running fine except the calculations i do on the audio in the callback are completely wrong (like wrong samplerate).


If i record a testtone via the line input on the MacBook in the SpeakHere example and play it back, it clicks just like it's skipping samples,
but if i play the same file in the Finder it's OK ?






OSStatus result = AudioSessionInitialize (
NULL,
NULL,
interruptionListenerCallback,
self
);
if(result)
printf("AudioSessionInitialize %d \n",result);
self.isActive = NO;
UInt32 sessionCategory = kAudioSessionCategory_RecordAudio;
AudioSessionSetProperty (
kAudioSessionProperty_AudioCategory,
sizeof (sessionCategory),
&sessionCategory
);

UInt32 sizeOfRecordingFormatASBDStruct = sizeof (audioFormat);

result = AudioQueueGetProperty (
queueObject,
kAudioQueueProperty_StreamDescription, // this constant is only available in iPhone OS
&audioFormat,
&sizeOfRecordingFormatASBDStruct
);
if(result)
printf("AudioQueueGetProperty1 %d \n",result);


// these statements define the audio stream basic description
// for the file to record into.
audioFormat.mSampleRate = 44100;
audioFormat.mFormatID = kAudioFormatLinearPCM;
audioFormat.mFormatFlags = kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked;
audioFormat.mFramesPerPacket = 1;
audioFormat.mChannelsPerFrame = 1;
audioFormat.mBitsPerChannel = 16;
audioFormat.mBytesPerPacket = 2;
audioFormat.mBytesPerFrame = 2;


//				[self setupAudioFormat: kAudioFormatLinearPCM];
//		audioFormat.mSampleRate			= 176400;




		result = AudioQueueNewInput (
							&audioFormat,
							recordingCallback,
							self,									// userData
							NULL,									// run loop
							NULL,									// run loop mode
							0,										// flags
							&queueObject
							);

		if(result)
			printf("AudioQueueNewInput %d \n",result);

// get the record format back from the queue's audio converter --
// the file may require a more specific stream description than was
// necessary to create the encoder.

result = AudioQueueGetProperty (
queueObject,
kAudioQueueProperty_StreamDescription, // this constant is only available in iPhone OS
&audioFormat,
&sizeOfRecordingFormatASBDStruct
);
if(result)
printf("AudioQueueGetProperty %d \n",result);


		result = AudioQueueAddPropertyListener (
									   [self queueObject],
									   kAudioQueueProperty_IsRunning,
									   propertyListenerCallback,
									   self
									   );
		if(result)
			printf("AudioQueueAddPropertyListener %d \n",result);

		result = AudioSessionSetActive (true);
		if(result)
			printf("AudioSessionSetActive %d \n",result);


result = AudioQueueGetProperty (
queueObject,
kAudioQueueProperty_StreamDescription, // this constant is only available in iPhone OS
&audioFormat,
&sizeOfRecordingFormatASBDStruct
);
if(result)
printf("AudioQueueGetProperty %d \n",result);



Peter Mark

Mark's Recording Studio A/S
Lundeskovsvej 3
2900 Hellerup
Denmark
Tel: +45 35366078
Fax: +45 35366038
Mobile: +45 20416018
www.marks-studio.dk
email@hidden

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Coreaudio-api mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >CoreAudio in Simulator Bug ? (From: Mark's Studio <email@hidden>)

  • Prev by Date: Re: Sync audio tracks
  • Next by Date: Re: ExtAudioFile and AIFF Files > 4GB
  • Previous by thread: CoreAudio in Simulator Bug ?
  • Next by thread: Re: setting mic volume
  • Index(es):
    • Date
    • Thread