• 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
old mtcoreaudio code doesn't work now
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

old mtcoreaudio code doesn't work now


  • Subject: old mtcoreaudio code doesn't work now
  • From: Robert Ackerman <email@hidden>
  • Date: Thu, 20 Dec 2007 23:11:21 -0800

my old code did an 'allocNewConverter' with calls that don't exist in the lastest version.
any hints on how to adapt this code. probably other issues after that, so any example code would help.


this is my current code that doesn't work:

- (void) allocNewConverter
{
NSLog(@"allocNewConverter");
Float64 inScale = ([self sampleRate] / [outputDevice nominalSampleRate]);
unsigned inBufferSize = ceil ( inScale * [outputDevice deviceMaxVariableBufferSizeInFrames] * SR_ERROR_ALLOWANCE );
if (inBuffer) MTAudioBufferListDispose(inBuffer);
inBuffer = MTAudioBufferListNew(1, inBufferSize, NO);


AudioStreamBasicDescription shtoomDescription;
shtoomDescription.mSampleRate = [self sampleRate];
shtoomDescription.mFormatID = kAudioFormatLinearPCM;
shtoomDescription.mFormatFlags = kLinearPCMFormatFlagIsPacked | kLinearPCMFormatFlagIsSignedInteger | kLinearPCMFormatFlagIsBigEndian | kAudioFormatFlagIsNonInterleaved;
shtoomDescription.mBytesPerFrame = sizeof(SInt16);
shtoomDescription.mFramesPerPacket = 1;
shtoomDescription.mBytesPerPacket = sizeof(SInt16);
shtoomDescription.mChannelsPerFrame = 1;
shtoomDescription.mBitsPerChannel = 16;
shtoomDescription.mReserved = 0;


[inConverter release];
inConverter = [[MTConversionBuffer alloc]
initWithSourceDescription:shtoomDescription
bufferFrames:inBufferSize
destinationDescription:[MTConversionBuffer descriptionForDevice:outputDevice forDirection:kMTCoreAudioDevicePlaybackDirection]
bufferFrames:ceil ( [outputDevice deviceMaxVariableBufferSizeInFrames] * SR_ERROR_ALLOWANCE )];


Float64 outScale = ([self sampleRate] / [inputDevice nominalSampleRate]);
unsigned outBufferSize = ceil ( outScale * [inputDevice deviceMaxVariableBufferSizeInFrames] * SR_ERROR_ALLOWANCE );
if (outBuffer) MTAudioBufferListDispose(outBuffer);
outBuffer = MTAudioBufferListNew(1, outBufferSize, NO);


[outConverter release];
outConverter = [[MTConversionBuffer alloc]
initWithSourceDescription:[MTConversionBuffer descriptionForDevice:inputDevice forDirection:kMTCoreAudioDeviceRecordDirection]
bufferFrames:outBufferSize
destinationDescription:shtoomDescription
bufferFrames:ceil ( [outputDevice deviceMaxVariableBufferSizeInFrames] * SR_ERROR_ALLOWANCE )];


}

_______________________________________________
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


  • Follow-Ups:
    • Re: old mtcoreaudio code doesn't work now
      • From: Jaime Magiera <email@hidden>
  • Prev by Date: Re: AUVal Reported error: kAudioUnitErr_TooManyFramesToProcess
  • Next by Date: Re: How to uniquely identify audio device
  • Previous by thread: Re: AUVal Reported error: kAudioUnitErr_TooManyFramesToProcess
  • Next by thread: Re: old mtcoreaudio code doesn't work now
  • Index(es):
    • Date
    • Thread