• 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
audio file bug in AudioUnitHosting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

audio file bug in AudioUnitHosting


  • Subject: audio file bug in AudioUnitHosting
  • From: Marc Poirier <email@hidden>
  • Date: Sun, 4 Jan 2004 11:09:50 -0600 (CST)

I just submitted this to RADAR, but I figured I'd post it here, too (and
my suggested fix) for anyone who might find it useful:


AudioUnitHosting has a bug with resolving the file paths of audio files
dropped onto its DataBrowser. It relies on CFStringGetCStringPtr() to get
a C string version of the CFString file path, which is failing in this
case 100% of the time, so AUH keeps aborting with an exception thrown
right after that when FSPathMakeRef fails.

I've changed the source code to convert the CFStringRef path to a CFURLRef
(instead of a C string) and then convert the CFURLRef to an FSRef, and now
it works reliably. The changes need to be made to
AudioEffectHosting::SelectedFile() and MusicDeviceHosting::SelectedFile()
in AudioUnitHosting.cpp. In both functions, you need to replace these
lines:


UInt8* thePath = (UInt8*)CFStringGetCStringPtr (inFilePath, kCFStringEncodingUTF8);

FSRef ref;
RequireNoErr(FSPathMakeRef ((const UInt8 *)thePath, &ref, NULL));


with these lines:


FSRef ref;
Boolean success = false;
if (inFilePath != NULL)
{
CFURLRef fileUrl = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, inFilePath, kCFURLPOSIXPathStyle, false);
if (fileUrl != NULL)
{
success = CFURLGetFSRef(fileUrl, &ref);
CFRelease(fileUrl);
}
}
if (!success)
return;
_______________________________________________
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.

  • Prev by Date: AU and Busses (or BusError?)
  • Next by Date: Re: audio file bug in AudioUnitHosting
  • Previous by thread: SaveState, VST2AU and AUValidation
  • Next by thread: Re: audio file bug in AudioUnitHosting
  • Index(es):
    • Date
    • Thread