Is there a way we can make an audio waveform?

Dell7730Dell7730 Member, PRO Posts: 388

something that will react to actual audio that plays in our games

Answers

  • SocksSocks London, UK.Member Posts: 12,822
    edited July 2015

    Whether you mean an actual waveform, i.e. the amplitude of the audio plotted over time - moving from right to left, or a frequency response, a static curve responding to the audio (which is what I suspect you mean ?) - neither are possible if the goal is to have them respond to actual in game audio, although you might be able to fake them.

    The waveform would be easy enough to fake, assuming this would be a song or perhaps a voice (you don't give any sort of details ?) simply make an image of the whole waveform (you can do this in various free audio editors like Audacity) and animate it moving left to right with the duration of its movement taking the same time as the length of the audio.

    A frequency response curve would be much harder to fake, I can think of ways to do it but it would be quite involved, that's to say not a simple automatic process, for example if you wanted this to respond to various in game sound effects (like explosions and gun shots) you could work out a rough frequency domain for each and every sound (easier than it sounds, you can even get away with a simple bass/mid/high done by ear) - and use information about when each one is played to add to an attribute (so - for example - when a deep boom sound plays the bass.attribute goes up by 1 for 0.5 seconds) - these attributes are then used to drive a graphic EQ style display or even (with a bit more work) a frequency response curve made from connected lines.

    Hope that makes sense !

    tl;dr There is nothing built in to GameSalad that will help you with this, but if you really wanted to do it and were prepared to do a fair bit of work you can certainly get some form of audio display going depending on your audio.

  • Dell7730Dell7730 Member, PRO Posts: 388

    @Socks said:
    Whether you mean an actual waveform, i.e. the amplitude of the audio plotted over time - moving from right to left, or a frequency response, a static curve responding to the audio (which is what I suspect you mean ?) - neither are possible if the goal is to have them respond to actual in game audio, although you might be able to fake them.

    The waveform would be easy enough to fake, assuming this would be a song or perhaps a voice (you don't give any sort of details ?) simply make an image of the whole waveform (you can do this in various free audio editors like Audacity) and animate it moving left to right with the duration of its movement taking the same time as the length of the audio.

    A frequency response curve would be much harder to fake, I can think of ways to do it but it would be quite involved, that's to say not a simple automatic process, for example if you wanted this to respond to various in game sound effects (like explosions and gun shots) you could work out a rough frequency domain for each and every sound (easier than it sounds, you can even get away with a simple bass/mid/high done by ear) - and use information about when each one is played to add to an attribute (so - for example - when a deep boom sound plays the bass.attribute goes up by 1 for 0.5 seconds) - these attributes are then used to drive a graphic EQ style display or even (with a bit more work) a frequency response curve made from connected lines.

    Hope that makes sense !

    tl;dr There is nothing built in to GameSalad that will help you with this, but if you really wanted to do it and were prepared to do a fair bit of work you can certainly get some form of audio display going depending on your audio.

    your first paragraph is what I'm talking about, lol... and yes, I would imagine faking it but that's not what I want.

    for me to fake it good, I could grab the waveform of the audio I want to play in my game using an editor, make it match the length of the audio and let it display as if it's a live.

  • SocksSocks London, UK.Member Posts: 12,822

    @Dell7730 said:
    your first paragraph is what I'm talking about, lol... and yes, I would imagine faking it but that's not what I want.

    >

    for me to fake it good, I could grab the waveform of the audio I want to play in my game using an editor, make it match the length of the audio and let it display as if it's a live.

    I don't understand your reply, you appear to be saying 'yes that's what I want' + 'that's not what I want' ?

    Confused !?

    A faked waveform would be no different from a real wave form, because a real waveform is not dynamic in anyway (unless you modulate the audio as it's playing, for example changing the volume), but in the case of something like a piece of music playing (without modulation of any kind) then there would be no difference at all between a live waveform (a live amplitude response to the playing music) and a pre-rendered waveform (in our case an image).

  • Dell7730Dell7730 Member, PRO Posts: 388

    @Socks said:

    Sorry bro, just so drunk right now and forcing myself to stay up, lol...

  • SocksSocks London, UK.Member Posts: 12,822

    @Dell7730 said:
    Sorry bro, just so drunk right now and forcing myself to stay up, lol...

    That's the spirit ! :smiley:

    It'll all make sense in the morning.

  • HopscotchHopscotch Member, PRO Posts: 2,782
    edited July 2015

    @Dell7730

    You could use Audacity to export the waveform peaks to a spreadsheet,
    import it as a table in GS
    and animate the output in sync with the playing music as a graph.

    Include as many tracks as you want this way.

    You could even represent multiple separate peaks (e.g. bass, treble) this way by capturing the values into columns.

Sign In or Register to comment.