Category Archives: Audio Tutorials

How to Add Music to Your iMovie Project

iMovie is one of the applications included in the iLife suite for the Macintosh. It is an easy-to-use video editing software that even beginners can use without a problem. iMovie versions 2.0.3 and earlier can be installed in Mac OS 9, while iMovie 3 and later can only run in Mac OS X. There is also iMovie HD, which was released in 2005, to be used for editing high-definition videos.

Adding Music to Your Movie
While editing your home video in iMovie, you might also want to add music to it. Music, when done perfectly, adds more feeling and emotion to the movie. It also helps your edits to have smooth transition. There are several ways of adding music to your project in iMovie. The first one is through the use of the menu on the toolbar. Simply click on File > Import then browse through the different folders on the window that comes up to locate the desired audio file. Highlight the file and click Open to import the file.

File Import
The file types that can be imported to iMovie are those that also run in Quicktime, such as MP3 and AIFF files. Those unsupported file types may be grayed out in the folder to indicate that it cannot be imported to iMovie.

A new track is added below the video track once the audio file is imported. The current location of the playhead is where the imported audio will begin playing. So make sure that your playhead is positioned correctly in the timeline before importing the audio file. The mode will automatically switch to “timeline viewer” mode once the track is already added since audio can only be edited in the timeline.

Two Audio Tracks
iMovie allows you to work with two audio tracks at the same time. That is why you will notice a space between the video track and the audio track that was just created. When another audio file is imported, it will most likely overlap the previous track. This does not edit nor cut the overlapped track, though. You can click on the track and drag it to the gray space in the middle for you to be able to edit both tracks. When both tracks are turned on, i.e. the box to the right of the timeline corresponding to the track is checked, the two tracks will play simultaneously but at different levels depending on the settings done to each of the track. You can turn off a track by unchecking the box.

iTunes and iMovie
Another quick way of adding music to your iMovie project is by clicking on the Audio button on the iMovie media menu. Once Audio is selected, a list of all the files in your iTunes library will be displayed on the right side of your iMovie window (on top of the media menu). Position the playhead where you want the music to begin. Choose your desired music then click on the Place at Playhead button to add the music to your project. If you are unsure of which to select, you can preview the song by clicking on the play symbol button just below the list.

Drag ‘n’ Drop
Yet another quick way of adding music is just by simply dragging the audio file from the CD, folder, or your desktop and dropping it onto the timeline. This will automatically import the file and create a new track.

Flash Audio: Creating a Sound On/Off Button

This tutorial will teach you how to create a Sound On / Off button for the music loop you have just added in the first flash tutorial.
This tutorial is built on top of the the tutorial ‘How To Import And Add Sound To A Movie‘ that deals with the basics of importing sounds to Flash. This means that this tutorial assumes that you have a sound loop imported into the library of your movie. With the music loop in your library we can start building a button.

Go to Insert -> New Symbol or press Ctrl + F8 (Image 1).

on off audio button in flash

Ok, now the dialog box titled ‘Create New Symbol’ appears. Type in the name box ‘SoundOnOffButton’ for type select ‘Button’ and click ‘Ok’. Before clicking the Ok button, you button should look similar to image 2.

sound on off button in flash project

The button appears in the library and you should be now in the editing mode of the button. Take a look at the image 3 so will know what I’m talking about.

sound on off button in flash

Rename the layer to ‘Speaker Graphic’. As you can suggest, the layer  will display a graphic with a simple speaker. I used the line tool to draw something like this on the image 4. It’s not fancy, I know, but you get the idea.

sound on off button in flash audio project

With this button, you can go to the main timeline by clicking on the back button above the timeline of the button (Image 5).

sound on off button in flash audio project

On the main timeline add an additional layer ‘Actions’. Now you should have two layers in the main timeline. The upper one renamed ‘Actions’ and the layer below renamed to ‘Content’. Select the first frame of the layer ‘Content’ and drag the SoundOnOffButton from the library somewhere on the stage. In my sample I placed it on the upper right corner of the Stage (Image 6). When placed on the stage, in the Properties panel, give it an instance name of ‘sound_btn’. To do this, keep the button selected on the stage, open the properties panel (Window -> Properites) and type ‘sound_btn’ in the left text box where it says ‘<Instance Name>’. See image 6.

audio loops in flash on off button

The next step you should do is to add a linkage name to your imported sound loop. To do this, open up the library, right click the sound file in select ‘Linkage…’ (Image 7).

soud on off button in flash

The ‘Linkage Properties’ dialog box appears. Check the option ‘Export for ActionScript’ and in the ‘Identifier’ text box, type in ‘myTrack’. Make sure the dialog box looks similar to image 8 and then click Ok.

sound on off button in flash how to

Now select the first frame of the layer Actions and open up the Actions layer (press F9). Type in (or paste) the following lines of code code:

var mySound:Sound = new Sound();
mySound.attachSound("myTrack");
mySound.start();
var soundStarted:Boolean = true;
sound_btn.onRelease = function() {
    soundStarted = !soundStarted;
    if (soundStarted) {
        this._alpha = 100;
        mySound.start();
    } else {
        this._alpha = 30;
        mySound.stop();
    }
};

Flash Audio: Pausing Sounds in Flash

This tutorial will show you how to create a pause button for the music loops you have added in the first tutorial.
This tutorial is built on top of the the tutorial ‘Creating a Sound On/Off Buttons’. You should complete the tutorial successfuly. Click here to open the tutorial. When you complete it you can come back here. Open the library from this tutorial and double click the button in library. Rename the button the ‘PauseSoundButton’ (Image 1).

creating a pause button for ausio in flash

Right click on the button and click ‘Edit…’. Remove the speaker graphic and add a simple text like ‘Pause Sound’ (Image 2).

creating a pause button for audio in flash

It’s noting spectacular as you can see, but up to you how you create your graphics. You can add what you want into the button.

As left from the previous tutorial, the button should be placed in the upper  right corner. Now click on the first frame of the ‘Actions’ layer, press F9 to open up the Actions panel. Remove the code from the previous tutorial and add the following code:

var mySound:Sound = new Sound();
mySound.attachSound("myTrack");
mySound.start();
var soundStarted:Boolean = true;
var lastPosition:Number = 0;
sound_btn.onRelease = function() {
    soundStarted = !soundStarted;
    if (soundStarted) {
        this._alpha = 100;
        mySound.start(lastPosition);
        //mySound.
    } else {
        this._alpha = 30;
        mySound.stop();
        lastPosition = Math.floor(mySound.position / 1000);
    }
};

That’s it! You have a functional pause button!

Flash Audio: Sound Fade In / Fade Out

Assuming you have successfully completed the previous tutorials I expect that I do not have to show you how to create buttons, import sounds, add graphics to sounds etc. In this tutorial we need to concetrate on the ActionScript that fades in/out the played sound.

Follow these steps to do this:

1.    Import a sound loop to you Flash Movie
2.    Give it a linkage ID ‘myTrack’
3.    Create to buttons. One with a plus sign inside and the other one with a minus sign inside. Place the on the stage like on the image 1.

Flash tutorial

4.    The plus button should have the instance name ‘fadeIn_btn’, the minus button ‘fadeOut_btn’.

The button should be placed on the layer ‘Content’. Above this layer, create a layer called ‘Actions’, select the first frame and open the Actions Panel (press F9). Paste the following code:

var mySound:Sound = new Sound();
mySound.attachSound("myTrack");
mySound.start();
var soundStarted:Boolean = true;
var lastPosition:Number = 0;
var id:Number;
fadeIn_btn.onRelease = fadeInSound;
function fadeInSound():Void {
    if (id) {
        clearInterval(id);
    }
    mySound.start(lastPosition);
    var volume = mySound.getVolume();
    id = setInterval(fadeIn, 10);
    function fadeIn():Void {
        mySound.setVolume(volume++);
        if (volume>=100) {
            clearInterval(id);
        }
    }
}
fadeOut_btn.onRelease = fadeOutSound;
function fadeOutSound():Void {
    if (id) {
        clearInterval(id);
    }
    var volume = mySound.getVolume();
    id = setInterval(fadeOut, 10);
    function fadeOut():Void {
        mySound.setVolume(volume–);
        if (volume<=0) {
            clearInterval(id);
            mySound.stop();
            lastPosition = Math.round(mySound.position/1000);
        }
    }
}

Flash Audio: Adding Sound Loops

Adding sound loops to a Flash Movie is a simple task. The first thing you have to do is to find the appropriate loop for your Flash Movie. We have lots of free royalty free music loops on our home page at Partners In Rhyme.com that you can download and use with these tutorials.
You can add sound loops for your animations such as cartoons or intros. The whole thing is very easy. If you have a Flash movie with content, like on image 1.

Flash audio tutorial

To add a loop to your movie, follow these steps:

1.    Add an extra layer called “Sound”.
2.    Import a sound loop the you Flash Movie.
3.    Select the first frame of the layer
4.    In the properties panel, in the “Sound” drop down menu, select the imported sound.

That’s all, now you can specify the number of times to loop! On image 3, you can how the image should know look like.

adding music loops to flash