How do I add a sound file to my iPad app?

I know absolutely nothing about working with sound files in Cocoa, so it would be great if I could get some advice on the following:
-What type of file should I be using? (I used QuickTime to record the sound clip, and that made it a .mov - should I rerecord it with something else?)
-Once I have the file ready to go, how do I get it into my xib file so the user can press a button and the app will play the sound?
Thank you!

You need to know how to add a framework and resources to your project, and how to wire up a button action in IB.
I use .wav files, but only because they're compatible and common for my needs. File names are case sensitive w/iOS, so be sure they match with your code.
http://www.edumobile.org/iphone/ipad-development/playing-audio-file-in-ipad/

Similar Messages

  • When I add a sound file to a slideshow the slides stop changing

    How can I add a sound file and have it play through the entire slideshow in Acrobat Pro X?

    Here is the solution. Go the area where you placed your the file, right click it and select properties, then change the Playback Style to "Play content in floating window". That solved the problem.

  • How do i add more sounds?????

    I have written the program below which contains two sound files which can be played, looped and stopped. However i want to add more sound files. The problem is how do i go about creating the sound list at the method getSelectedIndex().
    At current it displays after getSelectedIndex() == 0 ?
    sound1 : sound2;
    I tried sound1 : sound2 : sound3 : sound4;
    But this didnt work, i am fully aware i have to add to the getDocumentbase()method and define them.
    The program works that is shown below :
    // Java Core Packages
    import java.applet.Applet;
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    //Java extension packages
    import javax.swing.*;
    * Loads and Plays audio clips with
    * the addition of a loop function
    * @author L_Tambiah
    * @version 01
    public class LoadAudioAndPlay extends JApplet
    private AudioClip sound1, sound2, currentSound; //I know to add sound3 and sound4
    private JButton playSound, loopSound, stopSound;
    private JComboBox chooseSound;
    //load the image when the applet begins executing
    public void init()
    Container container = getContentPane();
    container.setLayout( new FlowLayout() );
    String choices[] = { "Bottle", "Flute"};
    chooseSound = new JComboBox( choices );
    chooseSound.addItemListener(
    new ItemListener()
    //stop sound and change to sound to users selection
    public void itemStateChanged( ItemEvent e )
    currentSound.stop();
    currentSound = chooseSound.getSelectedIndex() == 0 ?
    sound1 : sound2; //what do i do here???????????
    }// end anonymous inner class
    );// end addItemListener method call
    container.add( chooseSound );
    //set up button event handler and buttons
    ButtonHandler handler = new ButtonHandler();
    playSound = new JButton( "Play" );
    playSound.addActionListener( handler );
    container.add( playSound );
    loopSound = new JButton( "Loop" );
    loopSound.addActionListener( handler );
    container.add( loopSound );
    stopSound = new JButton( "Stop" );
    stopSound.addActionListener( handler );
    container.add( stopSound );
    //load sounds and set currentSound
    sound1 = getAudioClip( getDocumentBase(), "bottle.wav" );
    sound2 = getAudioClip( getDocumentBase(), "flute.aif" );
    //i know to add the getDocumentBase for sound 3 and 4
    currentSound = sound1;
    } //end method init
    //stop the sound when the user switches web pages
    public void stop()
    currentSound.stop();
    //private inner class to handle button events
    private class ButtonHandler implements ActionListener {
    //process play, loop and stop button events
    public void actionPerformed( ActionEvent actionEvent )
    if ( actionEvent.getSource() == playSound )
    currentSound.play();
    else if ( actionEvent.getSource() == loopSound )
    currentSound.loop();
    else if ( actionEvent.getSource() == stopSound )
    currentSound.stop();
    Any help id be gratefull for a solution
    Thankyou
    L.Tambiah

    the link is grey and wont let me select it
    What is your GarageBand version? In GarageBand 10.0 you can buy more sounds by an in-app purchase. If this link is greyed out, you either already bought it and should see "Restore Purchase" instead, or you are in a a country, where you cannot update GarageBand, because you bought it in a differnet country.
    To check, if you already have installed the in-app purchase, select a Drummer track and open the Library panel. If you have more than the one drummer "socal", you already have the in-app purchase installed.
    Another way to get more sounds and loops is to buy MainStage. This will give you the loops and sounds that come with the Jam Packs, plus many Logic sounds.

  • How can I transfer a sound file from my "Voice Memos" app on my iPhone to my iPad?

    How can I transfer a sound file from my "Voice Memos" app on my iPhone to my iPad?

    In iTunes with your iPhone connected, click on the iPhone device, select the Apps tab, scroll down to the File Sharing section and pick an app that plays Quicktimes ("Files Connect" works in this example, but I'm open to suggestions of better apps for playing transferred Quicktimes) and drag your Quicktime from Finder to the Documents pane for the File Sharing app.   Once the file transfer is complete, go to the app on your iPhone to play the Quicktime.

  • How do I add an existing file to a project?

    To add an existing files to a project in JDeveloper 9.0.5.2 I use File/Import and select "Existing Sources". In Jdeveloper 10.1.3.0.2 the "Existing Sources" option was substituted by "Create Project from Existing Source". The documentation topic in 10.1.3 “Adding Existing Files to an Existing Project Using the Add Files or Directories Dialog” indicates File/Open and use a “Add Files or Directories dialog” that I can not find.
    How do I add an existing file to a project?

    To add an existing files to a project in JDeveloper
    9.0.5.2 I use File/Import and select "Existing
    Sources". In Jdeveloper 10.1.3.0.2 the "Existing
    Sources" option was substituted by "Create Project
    from Existing Source". The documentation topic in
    10.1.3 “Adding Existing Files to an Existing
    Project Using the Add Files or Directories Dialog”
    indicates File/Open and use a “Add Files or
    Directories dialog” that I can not find.
    How do I add an existing file to a project?Right now you just need to copy the file into the sourcepath of your project, going forward we're going to provide some easier way to do this.
    i.e. you can use the windows explorer to copy C:\src\com\acme\MyClass.java to C:\jdev\mywork\Application1\Project1\src\com\acme\MyClass.java
    Hope this helps,
    Rob
    Team JDev

  • How do I add a log file to posts? (NT)

    How do I add a log file to posts?
    Thanks,

    here is the output of copy/paste:
    I [17/Oct/2007:05:51:44 -0500] Configured for up to 100 clients.
    I [17/Oct/2007:05:51:44 -0500] Allowing up to 100 client connections per host.
    I [17/Oct/2007:05:51:44 -0500] Using policy "default" as the default!
    I [17/Oct/2007:05:51:44 -0500] Full reload is required.
    I [17/Oct/2007:05:51:45 -0500] Loaded MIME database from '/etc/cups': 35 types, 40 filters...
    I [17/Oct/2007:05:51:46 -0500] Loading job cache file "/var/cache/cups/job.cache"...
    I [17/Oct/2007:05:51:46 -0500] Full reload complete.
    I [17/Oct/2007:05:51:46 -0500] Listening to :::631 on fd 2...
    I [17/Oct/2007:05:51:46 -0500] Listening to 0.0.0.0:631 on fd 3...
    I [17/Oct/2007:05:51:46 -0500] Listening to /var/run/cups/cups.sock on fd 4...
    (The strikethrough is one of the many bugs in the Forum software...)
    Use Console Utility to show you the log files, if that is what you need to know.

  • How can I add an audio file to each slide when I export to HTML Keynote 6.2

    How can I add an audio file to each slide when I export to HTML Keynote 6.2
    I am trying to create an audio slide show instead of a movie

    Drag and drop one music files onto each slide then export. (File > Export > HTML)

  • How do I enable all sound files wav,MP3 on windows 7 64-bit change system sounds

    How do I enable all sound files wav,MP3 on windows 7 64-bit change system sounds it will only give me the option to choose wav?

    Windows 7 uses .wav (wave) files for the sound events. The default folder that Windows 7 uses to store the sound files in is located at C:\Windows\Media.
    You cannot use a MP3 file but there are lots of (WAV to MP3 converters) available on internet which can help you to convert MP3 to wav  serving your purpose of changing system sound. 
    //Click on Kudos and Accept as Solution if my reply was helpful and answered your question//
    I am an HP employee!!

  • How do I add a PDF file for download to my iWeb page?

    How do I add a PDF file for download to my iWeb page?
    I have created one using Apples Pages program.
    Thanks!

    Hi-
    You need to create a text link to the file...
    On your page, type a word that you want to be the link... then select the word, and in the inspector pane, click the link tab (the arrow on the far right) and check "enable as hyperlink." Then choose "file" from the dropdown menu and a chooser box will open for you to locate the file on your hard drive.
    Choose the file by clicking "open" once it's located. Then the next time you publish, the file will be uploaded and linked to!
    Hope this helps... I think I got all the steps in there!

  • How do I record a sound file and send it as an attachment using my 4s?

    How do I record a sound file and send it as an attachment using my 4s?

    Hi,
    The following is the program[Click Here| http://saptechnical .com/Tips/ABAP/email/EmailProgram.txt] which will send any format file. Actual Creator of the program is Amit Bisht.
    Thanks & Regards,
    Rock.

  • How do i play two sound file one after another

    Hi All,
    How do i play two sound file one after another using single AudioClip Component?.
    Advance in thanks
    Manivel

    AudioClip gives you very little control over what happens to the sound, it also isn't capable of playing long clips or waiting until a clip ends. It will play multiple clips over top of each other.
    To do what you want you should use the facilities of javax.sound. Here's a post with an example: http://forum.java.sun.com/thread.jspa?forumID=513&threadID=450768
    There is also a tutorial, but its example fails for long clips.

  • How do I add pictures and files

    How do I add pictures and files to my iPod. I have the hard drive thing checked already.

    Here:
    http://www.apple.com/support/ipod/tutorial/ipgettingstartedt13.html

  • How do I stop a sound file that is playing while Firefox is open that sounds like a PacMan Game?

    How do I stop a sound file that is playing while Firefox is open that sounds like a PacMan Game? It started when I downloaded the current Adobe DLM, but continues when disable. It begins playing each time I open FireFox, but gets interferred with when opening a web page.
    == This happened ==
    Every time Firefox opened
    == 1520 hours, Central Time

    See [[Firefox makes random sounds]]

  • How do i add/covert WMA files to Itunes MPEG4

    how do i add/covert WMA files to Itunes MPEG4

    I have been searching for an easy way to convert files from my digital audio recorder to mp3 and/or iTunes and this is perfect and its easy to use.  Much better than Flip4Mac. Thanks for the information.

  • How do I transfer a .mov file to my iPad from my Mac?

    How do I transfer a .mov file to my iPad from my Mac?

    If .mov files are compatible with iPad, you can add your .mov file to iTunes and sync it to your iPad.

Maybe you are looking for