• 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
How to put a exs sample instrument to an iOS app bundle so AUSampler can properly load it
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

ffac

mcpl

/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,

                                  kAudioUnitScope_Global,

                                  0,

                                  &bpdata,

                                  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

  • Follow-Ups:
    • Re: How to put a exs sample instrument to an iOS app bundle so AUSampler can properly load it
      • From: Douglas Scott <email@hidden>
    • Re: How to put a exs sample instrument to an iOS app bundle so AUSampler can properly load it
      • From: Andrea Gozzi <email@hidden>
  • Prev by Date: Re: from xcode5 to xcode6-beta6, sounds are now distorted on iOS7
  • Next by Date: Re: from xcode5 to xcode6-beta6, sounds are now distorted on iOS7
  • Previous by thread: Re: How to stream an mp3 file to a web hosting service
  • Next by thread: Re: How to put a exs sample instrument to an iOS app bundle so AUSampler can properly load it
  • Index(es):
    • Date
    • Thread