Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Adding voices?

Discussion in 'Audio & Video' started by Bladefire30, Mar 23, 2015.

  1. Bladefire30

    Bladefire30

    Joined:
    Mar 23, 2015
    Posts:
    3
    I have the free version of Unity. I was wondering if there was anyway at all to get voices into your game. For example I would like the player to run up to someone and they say something to them. Something like
    NPC- Be carful there's zombies here.
    Player- Great, an over used concept.

    I would like to be able to have a back and forth. Or be able to have a "mission briefing" before the level. A voice tells you about the level along with text.
    Is any of this possible? I've looked up tutorials and never found any.
     
  2. elijahlucian

    elijahlucian

    Joined:
    May 30, 2014
    Posts:
    8
    If you figure it out, send me some lines for my cast.

    www.elijahlucian.ca/free-voice-acting
     
  3. RichardKain

    RichardKain

    Joined:
    Oct 1, 2012
    Posts:
    1,261
    Well, a simple collision trigger could be used to fire an event between two game objects. (the player and the npc) For playing back audio, you would just need an audio source attached to the player-perspective camera and the NPC. The rest is just a matter of timing.
     
  4. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,568
    I would suggest tackling other problems before you get into something specific like triggered audio. By the time you actually need them, you'll know how to do them already.
     
  5. RichardKain

    RichardKain

    Joined:
    Oct 1, 2012
    Posts:
    1,261
    I know they changed some things up for the Audio in the latest version of Unity. (5.0) But I've found in previous versions that getting basic audio to play back has actually been fairly easy.

    To start, you will want to record some audio to use. If you have any microphone at all, you're set. You don't have to worry about your vocal performance being extremely clear, or even particularly good. For testing purposes you just need a basic voice that can be understood. Grab a copy of Audacity, record a few test sentences, and save them in a compressed format such as MP3 or OGG. Drop those files somewhere into your Unity project's folder.

    They should now show up as Audio Clips. You should now be able to edit their import settings in Unity, as well as assign them to Audio controllers on your game objects, and play them back. I haven't tried this yet in Unity 5, so I can't speak to the details of this process, but in 4.6 it was rather straightforward. An AudioSource component gets applied to an object. An AudioListener component needs to be applied somewhere else in the scene. (the default camera comes with the component already applied) AudioClip resources from the Assets folder can be assigned to and played from Audio Sources. The rest was just rigging up the interactivity.