• 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
Making an Aiff file from an Midi file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Making an Aiff file from an Midi file


  • Subject: Making an Aiff file from an Midi file
  • From: Craig Bakalian <email@hidden>
  • Date: Tue, 2 Dec 2003 13:17:07 -0500

Shesh!

Man -o man! Debugging the threads of DiskWriterAUGraph is killing me!
All is well with the code that I have transformed for my apps needs,
yet my app is in objective c. Something is going wrong at the point of
a objective-c++ bridge file (with a .mm on the end) in the below code
where the while(PAUG->IsRunning()) is called. This code is unreliable,
or sometimes it actually writes the aiff with sound data in it with a
big EX_BAD_COMMAND error, or sometimes it writes a file with no sound
data in it with a big EX_BAD_COMMAND error.

-(void)startAiffProcessingWithAudioUnit: (AudioUnit)outputUnit
withAUGraph: (AUGraph)graph withSequence: (MusicSequence)sequence
directoryName: (NSString *)directory andFileName: (NSString *)fileName
{

const char* baseDir = new char[1024];
const char* baseFilename = new char[1024];

baseDir = [directory cString];
baseFilename = [fileName cString];

ProducerAUGraph *PAUG = new ProducerAUGraph (outputUnit, graph,
sequence, baseDir, baseFilename);
Float32 monitorValue = 0.10f;

while (PAUG->IsRunning())
{
usleep ( 250 * 1000 );
if (PAUG->GetPercentComplete() > monitorValue)
{
monitorValue += 0.10f;
}
}
delete PAUG;
}

To continue, if I get deeper into the ProducerAUGraph, it is indeed the
IsRunning() function that is causing all the errors. One more thing,
The example code calls for the below code to have if
(mIsRunningCallCount == 1) to start the thread, which I am unable to
do? It will only work if I set it to if (mIsRunningCallCount == 2).
Why? Please, there has got to be an engineer out there at apple that
is the author of this code? Please, Help! Or, is there an easier way,
in an objective- c project to push data out of output unit, and stuff
it in an aiff file.

void ProducerAUGraph::IsRunningPropertyListener (AudioUnit inAU,
AudioUnitPropertyID inID, AudioUnitScope inScope, AudioUnitElement
inElement)
{
mIsRunningCallCount++;
if (mIsRunningCallCount == 2) {
mProcessorThread->Start();
}
}
Craig Bakalian
www.eThinkingCap.com
_______________________________________________
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.

  • Follow-Ups:
    • Re: Making an Aiff file from an Midi file
      • From: Luke Bellandi <email@hidden>
  • Prev by Date: MusicPlayer as slave
  • Next by Date: Re: audio output interfaces
  • Previous by thread: Re: MusicPlayer as slave
  • Next by thread: Re: Making an Aiff file from an Midi file
  • Index(es):
    • Date
    • Thread