Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 01-06-2010, 01:04 AM   #1 (permalink)
Registered Member
 
Join Date: Dec 2008
Posts: 8
Default Recording option for sound processed from augraph

Hi All

Iam working on a audio mixer project by merging the features of "SpeakHere" and "iPhoneMultichannelMixerTest" sample codes.

Iam able to record audio from the mic but infact Iam trying out to record the sound processed from augraph.

The issue Iam facing is that when the sound from augraph is being played and I click the record button, the sound processed from augraph mutes or stops and audio from my mic gets recorded.

Please support me in figuring out the solution.

Thanks in Advance

------------------------------------
- (void)startRecording
{
[self setupAudioFormat:&recordState.dataFormat];
NSLog(@"-----------------");
recordState.currentPacket = 0;

OSStatus status;
status = AudioQueueNewInput(&recordState.dataFormat,
AudioInputCallback,
&recordState,
CFRunLoopGetCurrent(),
kCFRunLoopCommonModes,
0,
&recordState.queue);

if(status == 0)
{
for(int i = 0; i < NUM_BUFFERS; i++)
{
//appDelegate=[[UIApplication sharedApplication] delegate];
AudioQueueAllocateBuffer(recordState.queue,
16000, &recordState.buffers[i]);
AudioQueueEnqueueBuffer(recordState.queue,
recordState.buffers[i], 0, NULL);
}

status = AudioFileCreateWithURL(fileURL,
kAudioFileAIFFType,
&recordState.dataFormat,
kAudioFileFlags_EraseFile,
&recordState.audioFile);


if(status == 0)
{
recordState.recording = true;
status = AudioQueueStart(recordState.queue, NULL);
if(status == 0)
{
// labelStatus.text = @"Recording";
NSLog(@"Recording");
}
}
}

if(status != 0)
{
[self stopRecording];
// labelStatus.text = @"Record Failed";
NSLog(@"Record Failed");
}
}


- (void)setupAudioFormatAudioStreamBasicDescriptio n*)format
{
format->mSampleRate = 8000.0;
format->mFormatID = kAudioFormatLinearPCM;
format->mFramesPerPacket = 1;
format->mChannelsPerFrame = 1;
format->mBytesPerFrame = 2;
format->mBytesPerPacket = 2;
format->mBitsPerChannel = 16;
format->mReserved = 0;
format->mFormatFlags = kLinearPCMFormatFlagIsBigEndian |
kLinearPCMFormatFlagIsSignedInteger |
kLinearPCMFormatFlagIsPacked;
}


void AudioInputCallback(
void *inUserData,
AudioQueueRef inAQ,
AudioQueueBufferRef inBuffer,
const AudioTimeStamp *inStartTime,
UInt32 inNumberPacketDescriptions,
const AudioStreamPacketDescription *inPacketDescs)
{
RecordState* recordState = (RecordState*)inUserData;
if(!recordState->recording)
{
printf("Not recording, returning\n");
}

//if(inNumberPacketDescriptions == 0 && recordState->dataFormat.mBytesPerPacket != 0)
//{
// inNumberPacketDescriptions = inBuffer->mAudioDataByteSize / recordState->dataFormat.mBytesPerPacket;
//}

printf("Writing buffer %d\n", recordState->currentPacket);
OSStatus status = AudioFileWritePackets(recordState->audioFile,
false,
inBuffer->mAudioDataByteSize,
inPacketDescs,
recordState->currentPacket,
&inNumberPacketDescriptions,
inBuffer->mAudioData);
if(status == 0)
{
recordState->currentPacket += inNumberPacketDescriptions;
}

AudioQueueEnqueueBuffer(recordState->queue, inBuffer, 0, NULL);
}
blackspear is offline   Reply With Quote
Old 01-06-2010, 04:28 AM   #2 (permalink)
Registered Member
 
Join Date: Dec 2008
Posts: 8
Default

Hi

Iam still looking at least for a hint on how to solve the issue..

Basically, I have the audio running out of iphone speakers from augraph and i just need to record what is being played live from the speakers. That is fine enough for me.

Please provide some support

Thanks..
blackspear is offline   Reply With Quote
Old 02-25-2010, 07:09 AM   #3 (permalink)
iGuru
 
Join Date: Oct 2009
Location: India
Posts: 12
Send a message via Yahoo to pratikgoswami Send a message via Skype™ to pratikgoswami
Default

Quote:
Hi

Iam still looking at least for a hint on how to solve the issue..

Basically, I have the audio running out of iphone speakers from augraph and i just need to record what is being played live from the speakers. That is fine enough for me.

Please provide some support

Thanks..
Hi BlackSpear,

I am looking for the same solution. In my case I want to write buffers from Live Audio Stream to a audio file.

Any help would be appreciated.

Many thanks

Pratik
pratikgoswami is offline   Reply With Quote
Old 03-16-2010, 02:50 AM   #4 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 3
Default

Quote:
Originally Posted by pratikgoswami View Post
Hi BlackSpear,

I am looking for the same solution. In my case I want to write buffers from Live Audio Stream to a audio file.

Any help would be appreciated.

Many thanks

Pratik
I'm looking for the same solution.
mahmudmcc is offline   Reply With Quote
Reply

Bookmarks

Tags
audio, augraph

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 249
20 members and 229 guests
ADY, bookesp, ckgni, dacapo, Dani77, DarkAn, Davey555, Desert Diva, HemiMG, iDifferent, jakerocheleau, JasonR, LEARN2MAKE, prchn4christ, Rudy, ryantcb, Speed, themathminister, theone8one
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,885
Threads: 89,230
Posts: 380,766
Top Poster: BrianSlick (7,129)
Welcome to our newest member, bookesp
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:40 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0