Created: 10/28/2015 7:28:32 PM
Updated: 7/3/2017 3:28:11 PM

Game Sound Effects

Joined: 12/24/2018
Thread Replies: 28
Thread Followers: 58
Category

New to Audio Programming

Hello everyone! I am interested in learning programming for in game audio! If there are any tips, ideas, websites, or videos you would like to share, please do so here! I am new to programming, so bear with me!

Thanks!

 Links so far:

A tutorial site for C#

http://www.thoucurator.com/blog/viewpost?postid=39

 A video about OOP

Game Theory There is a four section part about audio programming.

Creating Sound- Audio Programming


-Robert GameSoundEffect


Awards: Filling in a signature on your profile. Has had another status other then active. Has not taken time off for more than 12 months. Attendant 3 meeting or more in 6 month period. Created 9 liaison message in 6 month period. Acquired more then 180 hours in the role 2 Has over 312 created items for the team. Served more then 9 months on team.

Created: 6/10/2016 10:45:12 PM
Updated: 10/13/2018 3:04:51 AM

Game Sound Effects

Joined: 10/1/2018
Member Replies 197
Member Follows 63
I can seem to find out exactly what's wrong. Try adding some debug statements (debug.log(myMusic.Length);) after you create your old statement and see if it's loading everything and you can use he statements with different variables in different places to see if code is being called

GameProgrammer  - Anthony Michelizzi

Awards: Filling in a signature on your profile. Has had another status other then active. Has not taken time off for more than 12 months. Attendant 3 meeting or more in 6 month period. Created 9 liaison message in 6 month period. Acquired more then 180 hours in the role 2 Has over 312 created items for the team. Served more then 9 months on team.
Created: 6/8/2016 2:32:52 PM
Updated: 10/25/2018 3:04:27 AM

Game Sound Effects

Joined: 12/24/2018
Member Replies 157
Member Follows 58
For some reason playing the array stopped working. Any Idea?

using UnityEngine;
using System.Collections;


public class Shells : MonoBehaviour {
Object[] myMusic; // declare this as Object array

void Awake()
{
myMusic = Resources.LoadAll("Music",typeof(AudioClip));
GetComponent().clip = myMusic[0] as AudioClip;
}


// Use this for initialization
void Start() {

}


// Update is called once per frame
void Update()
{
if (Input.GetMouseButtonDown(0))
{
GetComponent().volume = Random.Range(0.85f, 1);
GetComponent().pitch = Random.Range(0.92f, 1.03f);
}
}
void playRandomMusic(){
GetComponent().clip = myMusic[Random.Range(0, myMusic.Length)] as AudioClip; GetComponent().Play();
}
}

-Robert GameSoundEffect

Awards: Filling in a signature on your profile. Has had another status other then active. Has not taken time off for more than 12 months. Attendant 3 meeting or more in 6 month period. Created 9 liaison message in 6 month period. Acquired more then 180 hours in the role 2 Has over 312 created items for the team. Served more then 9 months on team.
Created: 6/3/2016 10:02:51 PM
Updated: 10/13/2018 3:04:51 AM

Game Sound Effects

Joined: 10/1/2018
Member Replies 197
Member Follows 63
IEnumerator WaitToPlay() {
yield return new WaitForSeconds(0.4f);
//play music code here
}

then for your function is called for the button press you use StartCoroutine(WaitToPlay());

GameProgrammer  - Anthony Michelizzi

Awards: Filling in a signature on your profile. Has had another status other then active. Has not taken time off for more than 12 months. Attendant 3 meeting or more in 6 month period. Created 9 liaison message in 6 month period. Acquired more then 180 hours in the role 2 Has over 312 created items for the team. Served more then 9 months on team.
Created: 6/3/2016 9:54:52 PM
Updated: 10/25/2018 3:04:27 AM

Game Sound Effects

Joined: 12/24/2018
Member Replies 157
Member Follows 58
Awesome! It works! now is there a way to delay it? like in JS there is ... i believe "Yield".

Just need to delay it about 0.4 seconds after I press the button down.

Thanks!

-Robert GameSoundEffect

Awards: Filling in a signature on your profile. Has had another status other then active. Has not taken time off for more than 12 months. Attendant 3 meeting or more in 6 month period. Created 9 liaison message in 6 month period. Acquired more then 180 hours in the role 2 Has over 312 created items for the team. Served more then 9 months on team.
Created: 6/3/2016 1:08:06 PM
Updated: 10/13/2018 3:04:51 AM

Game Sound Effects

Joined: 10/1/2018
Member Replies 197
Member Follows 63
Alright, I updated the code below. This will play a random sound out of the Resources/Music folder on start. not quite on your click but knowing this, and knowing how to play a sound on click you should be able to combine the two and make it work. 

GameProgrammer  - Anthony Michelizzi

Awards: Filling in a signature on your profile. Has had another status other then active. Has not taken time off for more than 12 months. Attendant 3 meeting or more in 6 month period. Created 9 liaison message in 6 month period. Acquired more then 180 hours in the role 2 Has over 312 created items for the team. Served more then 9 months on team.
Created: 6/3/2016 1:46:08 AM
Updated: 10/13/2018 3:04:51 AM

Game Sound Effects

Joined: 10/1/2018
Member Replies 197
Member Follows 63
Apparently this doesn't like my phone. If you can read it great, otherwise I'll parse it out later when I get home

GameProgrammer  - Anthony Michelizzi

Awards: Filling in a signature on your profile. Has had another status other then active. Has not taken time off for more than 12 months. Attendant 3 meeting or more in 6 month period. Created 9 liaison message in 6 month period. Acquired more then 180 hours in the role 2 Has over 312 created items for the team. Served more then 9 months on team.
Created: 6/3/2016 1:45:29 AM
Updated: 10/13/2018 3:04:51 AM

Game Sound Effects

Joined: 10/1/2018
Member Replies 197
Member Follows 63
using UnityEngine;
using System.Collections;

public class Music : MonoBehaviour {

Object[] myMusic; // declare this as Object array

void Awake () {
    myMusic = Resources.LoadAll("Music",typeof(AudioClip));
    audio.clip = myMusic[0] as AudioClip;
}

void Start (){
    audio.Play();
}
void Update () {
    if(!audio.isPlaying)
        playRandomMusic();
}

void playRandomMusic() {
    audio.clip = myMusic[Random.Range(0,myMusic.Length)] as AudioClip;             audio.Play();
}
}

Place the audio clips in a folder called Resources/Music for load all to find them
GameProgrammer  - Anthony Michelizzi

Awards: Filling in a signature on your profile. Has had another status other then active. Has not taken time off for more than 12 months. Attendant 3 meeting or more in 6 month period. Created 9 liaison message in 6 month period. Acquired more then 180 hours in the role 2 Has over 312 created items for the team. Served more then 9 months on team.
Created: 6/2/2016 9:17:50 PM
Updated: 10/25/2018 3:04:27 AM

Game Sound Effects

Joined: 12/24/2018
Member Replies 157
Member Follows 58
Hey guys, I need some coaching here. I have been playing around in Unity a little bit.
So I attached this script to an object in Unity:



using UnityEngine;
using System.Collections;

public class Minigun : MonoBehaviour {

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {
if (Input.GetMouseButtonDown(0))
{
this.GetComponent().Play();
GetComponent().volume = Random.Range(0.8f, 1);
GetComponent().pitch = Random.Range(0.99f, 1.1f);
}
}
}



Just testing out some sounds.

What would be the next step to add shells? 
There is about 8 shell sounds that I would like to play randomly once each time the gun is fired.

Thanks!

-Robert GameSoundEffect

Awards: Filling in a signature on your profile. Has had another status other then active. Has not taken time off for more than 12 months. Attendant 3 meeting or more in 6 month period. Created 9 liaison message in 6 month period. Acquired more then 180 hours in the role 2 Has over 312 created items for the team. Served more then 9 months on team.
Created: 5/17/2016 6:48:32 PM
Updated: 10/25/2018 3:04:27 AM

Game Sound Effects

Joined: 12/24/2018
Member Replies 157
Member Follows 58
Thanks Anthony!
Great information in there.

-Robert GameSoundEffect

Awards: Filling in a signature on your profile. Has had another status other then active. Has not taken time off for more than 12 months. Attendant 3 meeting or more in 6 month period. Created 9 liaison message in 6 month period. Acquired more then 180 hours in the role 2 Has over 312 created items for the team. Served more then 9 months on team.
Created: 5/17/2016 12:05:59 PM
Updated: 10/13/2018 3:04:51 AM

Game Sound Effects

Joined: 10/1/2018
Member Replies 197
Member Follows 63
@Robert. I stumbled across this today seems to have a lot of info. Not sure if it can help you much. I'm having an issue trying to even find much about audio programming in c#. http://creatingsound.com/2012/09/audio-programming-primer-2/

GameProgrammer  - Anthony Michelizzi

Awards: Filling in a signature on your profile. Has had another status other then active. Has not taken time off for more than 12 months. Attendant 3 meeting or more in 6 month period. Created 9 liaison message in 6 month period. Acquired more then 180 hours in the role 2 Has over 312 created items for the team. Served more then 9 months on team.
Created: 5/7/2016 9:58:22 PM
Updated: 10/13/2018 3:04:51 AM

Game Sound Effects

Joined: 10/1/2018
Member Replies 197
Member Follows 63
It's fairly old so I guess that's a downfall. He went over code too I just don't know if he covers all of it or just a small portion.

GameProgrammer  - Anthony Michelizzi

Awards: Filling in a signature on your profile. Has had another status other then active. Has not taken time off for more than 12 months. Attendant 3 meeting or more in 6 month period. Created 9 liaison message in 6 month period. Acquired more then 180 hours in the role 2 Has over 312 created items for the team. Served more then 9 months on team.
Created: 5/7/2016 9:54:16 PM
Updated: 10/25/2018 3:04:27 AM

Game Sound Effects

Joined: 12/24/2018
Member Replies 157
Member Follows 58
Interesting stuff, unfortunately I wasn't able to download the code.

-Robert GameSoundEffect

Awards: Filling in a signature on your profile. Has had another status other then active. Has not taken time off for more than 12 months. Attendant 3 meeting or more in 6 month period. Created 9 liaison message in 6 month period. Acquired more then 180 hours in the role 2 Has over 312 created items for the team. Served more then 9 months on team.
Created: 5/7/2016 7:36:03 PM
Updated: 10/25/2018 3:04:27 AM

Game Sound Effects

Joined: 12/24/2018
Member Replies 157
Member Follows 58
Ah, very well. I will look into this! Thanks for the link and your time!

-Robert GameSoundEffect

Awards: Filling in a signature on your profile. Has had another status other then active. Has not taken time off for more than 12 months. Attendant 3 meeting or more in 6 month period. Created 9 liaison message in 6 month period. Acquired more then 180 hours in the role 2 Has over 312 created items for the team. Served more then 9 months on team.
Created: 5/7/2016 5:05:12 PM
Updated: 10/13/2018 3:04:51 AM

Game Sound Effects

Joined: 10/1/2018
Member Replies 197
Member Follows 63
Robert, sorry to cut my last response short as I am at work. I am going to link you to a game theory blog that has a 4 part section on audio programming. If you have any questions feel free to still ask them I will reply. And after the weekend i can sit down and we can cover more code and expand on what's in that blog if you would like.

Game Theory

GameProgrammer  - Anthony Michelizzi

Awards: Filling in a signature on your profile. Has had another status other then active. Has not taken time off for more than 12 months. Attendant 3 meeting or more in 6 month period. Created 9 liaison message in 6 month period. Acquired more then 180 hours in the role 2 Has over 312 created items for the team. Served more then 9 months on team.
Created: 5/7/2016 4:05:12 PM
Updated: 10/13/2018 3:04:51 AM

Game Sound Effects

Joined: 10/1/2018
Member Replies 197
Member Follows 63
The downside to Xenko is that it's very limited on what it can do. There is stuff I can do easily with XNA alone that with Xenko is either impossible or very hard to accomplish. If you can do it in c#, you can always apply it to projects later as well.

GameProgrammer  - Anthony Michelizzi

Awards: Filling in a signature on your profile. Has had another status other then active. Has not taken time off for more than 12 months. Attendant 3 meeting or more in 6 month period. Created 9 liaison message in 6 month period. Acquired more then 180 hours in the role 2 Has over 312 created items for the team. Served more then 9 months on team.
Created: 5/7/2016 3:16:57 PM
Updated: 10/25/2018 3:04:27 AM

Game Sound Effects

Joined: 12/24/2018
Member Replies 157
Member Follows 58
Correct, but you can guide me in whichever direction that is best for the team.
-Robert GameSoundEffect

Awards: Filling in a signature on your profile. Has had another status other then active. Has not taken time off for more than 12 months. Attendant 3 meeting or more in 6 month period. Created 9 liaison message in 6 month period. Acquired more then 180 hours in the role 2 Has over 312 created items for the team. Served more then 9 months on team.
Created: 5/7/2016 3:13:46 PM
Updated: 10/13/2018 3:04:51 AM

Game Sound Effects

Joined: 10/1/2018
Member Replies 197
Member Follows 63
I'm assuming non game engine audio as well, right?

GameProgrammer  - Anthony Michelizzi

Awards: Filling in a signature on your profile. Has had another status other then active. Has not taken time off for more than 12 months. Attendant 3 meeting or more in 6 month period. Created 9 liaison message in 6 month period. Acquired more then 180 hours in the role 2 Has over 312 created items for the team. Served more then 9 months on team.
Created: 5/7/2016 3:10:19 PM
Updated: 10/25/2018 3:04:27 AM

Game Sound Effects

Joined: 12/24/2018
Member Replies 157
Member Follows 58
@ Anthony

I am more familiar with C# than with C++. But let's just say that I am a novice, still learning the basics.

I would like to learn how to load a sound, then play it when an action is called (i.e. a button pressed.)

I would also like to have it play at a random pitch each time, that way the sound doesn't get that repetitive.

Thanks!

-Robert

-Robert GameSoundEffect

Awards: Filling in a signature on your profile. Has had another status other then active. Has not taken time off for more than 12 months. Attendant 3 meeting or more in 6 month period. Created 9 liaison message in 6 month period. Acquired more then 180 hours in the role 2 Has over 312 created items for the team. Served more then 9 months on team.
Created: 11/8/2015 11:45:20 PM
Updated: 10/25/2018 3:04:27 AM

Game Sound Effects

Joined: 12/24/2018
Member Replies 157
Member Follows 58
Excellent! Thanks Nick!

-Robert GameSoundEffect

Awards: Filling in a signature on your profile. Has had another status other then active. Has not taken time off for more than 12 months. Attendant 3 meeting or more in 6 month period. Created 9 liaison message in 6 month period. Acquired more then 180 hours in the role 2 Has over 312 created items for the team. Served more then 9 months on team.
Created: 11/7/2015 7:49:57 PM
Updated: 5/15/2017 12:55:59 PM

Game Sound Effects

Joined: 11/6/2015
Member Replies 60
Member Follows 25
@Robert click that link then on the right hand side there will be a "download zip" button. The actual code is in the sources/engine folder. The actual program is in the build folder (I believe), Paradox.sln.

Thanks,
Nick


Awards: Filling in a signature on your profile. Has had another status other then active. Has not taken time off for more than 12 months. Attendant 3 meeting or more in 6 month period. Created 9 liaison message in 6 month period. Acquired more then 180 hours in the role 2 Has over 312 created items for the team. Served more then 9 months on team.
Created: 11/7/2015 7:15:04 PM
Updated: 10/25/2018 3:04:27 AM

Game Sound Effects

Joined: 12/24/2018
Member Replies 157
Member Follows 58
@ Anthony
Noob question. How do you go about downloading the source code for the engine?
I looked here https://github.com/SiliconStudio/paradox but for some reason it said it has moved or is unavailable. 
Can I get it from somewhere else?

Thanks for your time :)

-Robert GameSoundEffect

Awards: Filling in a signature on your profile. Has had another status other then active. Has not taken time off for more than 12 months. Attendant 3 meeting or more in 6 month period. Created 9 liaison message in 6 month period. Acquired more then 180 hours in the role 2 Has over 312 created items for the team. Served more then 9 months on team.
Created: 10/30/2015 11:13:52 PM
Updated: 10/13/2018 3:04:51 AM

Game Sound Effects

Joined: 10/1/2018
Member Replies 197
Member Follows 63

http://www.thoucurator.com/asset.information/viewasset?assetid=492

 

If you can download that as well there is two methods that use SoundEffect and SoundMusic in paradox to call audio. 



GameProgrammer  - Anthony Michelizzi

Awards: Filling in a signature on your profile. Has had another status other then active. Has not taken time off for more than 12 months. Attendant 3 meeting or more in 6 month period. Created 9 liaison message in 6 month period. Acquired more then 180 hours in the role 2 Has over 312 created items for the team. Served more then 9 months on team.
Created: 10/30/2015 11:12:54 PM
Updated: 10/13/2018 3:04:51 AM

Game Sound Effects

Joined: 10/1/2018
Member Replies 197
Member Follows 63

Repeat message,  sorry


GameProgrammer  - Anthony Michelizzi

Awards: Filling in a signature on your profile. Has had another status other then active. Has not taken time off for more than 12 months. Attendant 3 meeting or more in 6 month period. Created 9 liaison message in 6 month period. Acquired more then 180 hours in the role 2 Has over 312 created items for the team. Served more then 9 months on team.
Created: 10/30/2015 11:02:06 PM
Updated: 10/25/2018 3:04:27 AM

Game Sound Effects

Joined: 12/24/2018
Member Replies 157
Member Follows 58

Awards: Filling in a signature on your profile. Has had another status other then active. Has not taken time off for more than 12 months. Attendant 3 meeting or more in 6 month period. Created 9 liaison message in 6 month period. Acquired more then 180 hours in the role 2 Has over 312 created items for the team. Served more then 9 months on team.
Created: 10/29/2015 1:59:43 PM
Updated: 10/25/2018 3:04:27 AM

Game Sound Effects

Joined: 12/24/2018
Member Replies 157
Member Follows 58

Thanks James!:)



-Robert GameSoundEffect

Awards: Filling in a signature on your profile. Has had another status other then active. Has not taken time off for more than 12 months. Attendant 3 meeting or more in 6 month period. Created 9 liaison message in 6 month period. Acquired more then 180 hours in the role 2 Has over 312 created items for the team. Served more then 9 months on team.
Created: 10/29/2015 9:26:42 AM
Updated: 9/26/2022 7:54:28 PM

Game Sound Effects

Joined: 2/4/2017
Member Replies 748
Member Follows 126

Just figure I would compile a list of everything covered on other post for this thread.

  • Blog post from a new programmer on whats technology are involved in game programming.
  • You tube video covering the topic OOP
  • A tutorial site for C#
  • And of course any .NET 4.5+ C# book all programmers should have one or six of them different version etc like me :)

Thanks,
James Fleming



Thanks,
James Fleming 
Facebook
Discord

Awards: Filling in a signature on your profile. Has had another status other then active. Has not taken time off for more than 12 months. Attendant 3 meeting or more in 6 month period. Created 9 liaison message in 6 month period. Acquired more then 180 hours in the role 2 Has over 312 created items for the team. Served more then 9 months on team.
Created: 10/28/2015 10:27:17 PM
Updated: 10/25/2018 3:04:27 AM

Game Sound Effects

Joined: 12/24/2018
Member Replies 157
Member Follows 58

Awesome! Thanks Anthony! Reply:



-Robert GameSoundEffect

Awards: Filling in a signature on your profile. Has had another status other then active. Has not taken time off for more than 12 months. Attendant 3 meeting or more in 6 month period. Created 9 liaison message in 6 month period. Acquired more then 180 hours in the role 2 Has over 312 created items for the team. Served more then 9 months on team.
Created: 10/28/2015 8:48:51 PM
Updated: 10/13/2018 3:04:51 AM

Game Sound Effects

Joined: 10/1/2018
Member Replies 197
Member Follows 63

For paradox, go to their github page, and download the source code for the engine. In there you can find the Siliconstudios.paradox.audio names pace and there will be all the audio source code that they use. Then open a new project in paradox and hash out what you see and try to compile what works from what they tell you. Really the best way to learn is to do. 



GameProgrammer  - Anthony Michelizzi

Awards: Filling in a signature on your profile. Has had another status other then active. Has not taken time off for more than 12 months. Attendant 3 meeting or more in 6 month period. Created 9 liaison message in 6 month period. Acquired more then 180 hours in the role 2 Has over 312 created items for the team. Served more then 9 months on team.

×
MEMBER
Login
SERVICES
Animator Artist 2d Artist 3d Audio Engineer Game Creation Game Producer Graphic Designer Marketing Package Asset Programmer Story & Asset Writer Tutorial Video Production
ARTICLE CATEGORY
Animation Audio Production Cloud Gaming Game Development Graphic Design Marketing NFT Game Development Services Video Production