How to put a exs sample instrument to an iOS app bundle so AUSampler can properly load it
How to put a exs sample instrument to an iOS app bundle so AUSampler can properly load it
- Subject: How to put a exs sample instrument to an iOS app bundle so AUSampler can properly load it
- From: Dmitry Klochkov <email@hidden>
- Date: Tue, 02 Sep 2014 17:30:50 +0400
I have read Technical Note TN2283, and successfully load some exs instrument from GarageBand into my application.
But I can't load exs instruments that I created myself.
What I did:
I opened default Acoustic Guitar instrument that goes with Logic pro and exported it to the home folder using EXS24.
So now I have these files:
/Users/dk/Sampler Instruments/Acoustic Guitar.exs
/Users/dk/Acoustic Guitar/Acoustic Guitar_consolidated.caf
Executing command strings ./Acoustic\ Guitar.exs at folder /Users/dk/Sampler Instruments/ ,
I am getting this at the end of command execution result:
.......
TBOSAcoustic Guitar_con#17C03AD.caf
/Users/dk/Acoustic Guitar
Acoustic Guitar_consolidated.caf
Then I put those files in my iOS app in this structure:
<bundle>/Acoustic Guitar.exs
<bundle>/dk/Acoustic Guitar/Acoustic Guitar_consolidated.caf
I am loading instruments to AUSampler with this code:
NSString *path = [[NSBundle mainBundle] pathForResource:@"Acoustic Guitar" ofType:@"exs"];
NSURL *presetURL = [[NSURL alloc] initFileURLWithPath: path];
AUSamplerInstrumentData bpdata = {0};
bpdata.fileURL = (__bridge CFURLRef)(presetURL);
bpdata.instrumentType = kInstrumentType_EXS24;
CheckError(AudioUnitSetProperty(player->instrumentUnit,
kAUSamplerProperty_LoadInstrument,
sizeof(bpdata)), "Couldn't set exs instrument on AUSampler");
When I run my app I get the errors:
Failed to locate sample 'Acoustic Guitar_con#17C03AD.caf -- file:///Users/dk/Acoustic Guitar/'
GlobalState::LoadEXS24Instrument: Load failed
What I am doing wrong? What is the proper way to put custom exs instruments to an iOS application?
_______________________________________________
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