Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

WIP: Directional audio sources (think spotlights)

Discussion in 'Works In Progress - Archive' started by lakulish, May 16, 2014.

  1. lakulish

    lakulish

    Joined:
    Apr 3, 2014
    Posts:
    5
    Hi everybody,

    I'm working on an editor extension that lets you attach "directivity" to AudioSources. One example might be a "spotlight" sound source, where the sound is at its loudest within a narrow cone in front of the source, and softer everywhere else (and maybe completely silent behind it).

    As I work on this plugin, I was wondering if anyone on here had any thoughts about what kinds of sound source directivities might be useful. Also, what are some good scenarios in which they might be useful?

    This will help me put together a useful set of features :)

    Thanks!
     
  2. lakulish

    lakulish

    Joined:
    Apr 3, 2014
    Posts:
    5
    As an example of what I mean by directional audio sources, check out the following video:

    [video=youtube_share;uxj9BzZrBzQ]http://youtu.be/uxj9BzZrBzQ

    The spinning red sphere is the sound source, and the green dot is the player's (listener's) position.

    The video shows a couple of different kinds of spotlight sources, with different widths. Also, there are three "custom" directivities, where the intensity in different directions is controlled by a curve.

    Hopefully these examples give a better idea of what directional sound sources are.

    Do these kinds of directional sources seem like they might be useful in a game? If not, why not?
     
  3. FBTH

    FBTH

    Joined:
    Jul 25, 2012
    Posts:
    272
    Looks like it'd be good for like a turbine spinning.
     
  4. Fanttum

    Fanttum

    Joined:
    May 18, 2014
    Posts:
    39
    I'd love something like that.
    Great for speakers like a prop radio or an intercom loud speaker of sorts.

    Shouldn't be too hard to make I would think, however the way unity works with the Doppler effect might be tricky and something to look into depending on how your are coding this.
     
  5. lakulish

    lakulish

    Joined:
    Apr 3, 2014
    Posts:
    5
    Thanks for the responses, folks! Some great ideas here.

    I'm a little curious, though. What is tricky about Unity's approach to the Doppler effect? I haven't really looked into it in much detail, so any insight would be appreciated.

    Thanks! :)