Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8376849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:31:27+00:00 2026-06-09T15:31:27+00:00

I want to preload a *.wav file in my app since it is rather

  • 0

I want to preload a *.wav file in my app since it is rather large. I want to start loading it in viewcontroller1 and then play it in viewcontroller15. I need the code to preload it; the code for playing it is:

CFBundleRef mainbundle = CFBundleGetMainBundle();
CFURLRef soundFileURLRef;
soundFileURLRef =CFBundleCopyResourceURL(mainbundle, (CFStringRef) @"america", CFSTR ("wav"), NULL);
UInt32 soundID;
AudioServicesCreateSystemSoundID(soundFileURLRef, &soundID);
AudioServicesPlaySystemSound(soundID);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T15:31:29+00:00Added an answer on June 9, 2026 at 3:31 pm

    preloading a wav file’s header requires reading a very small amount of data. this will be enough to initialize your audio playback stream. you would also need to then fill your playback buffers (a rather small amount of data to read) to begin playback.

    to preload an audio file’s sample data, you can use AudioFile* APIs, and custom I/O callbacks.

    however, the scenario you describe is a good example of when not to preload an audio file’s sample data.

    a wav file can be streamed from disk in real time. it does not need to read the entire file’s sample data before playing. loading large audio files into memory is unnecessary for realtime playback. of course, iOS devices also have low memory ceilings.

    if preloading and initializing the stream is what you want, you can use ExtAudioFile* APIs and still stream using an API such as AudioQueue*.

    some more detail about the problem you are facing may help. i don’t see any good reason to preload an audio file’s sample data in this case; only negative side effects.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to show preload image while main page is preparing and then loading.
I want to preload two sound-files and play them on user event. Trying to
I want to preload a lot of images when my app starts up, sort
I'm looking to preload a website. I only want a loading bar once on
I want to preload a JS file and a CSS file from the landing
I want to have an embedded chromeless youtube video preload its video WITHOUT playing
I don't want to know a way to preload images, I found much on
I'm trying to preload about 150 images and I want to be able to
want to open pdf file when a user clicks on hyperlink shown in gridview
Want the function to sort the table by HP but if duplicate HPs then

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.