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

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. 



Awesome! Thanks Anthony! smile



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!:)




Repeat message,  sorry


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

 

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



@ 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 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

Excellent! Thanks Nick!

@ 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

I'm assuming non game engine audio as well, right?

Correct, but you can guide me in whichever direction that is best for the team.

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.

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

Ah, very well. I will look into this! Thanks for the link and your time!

Interesting stuff, unfortunately I wasn't able to download the code.

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.

@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/

Thanks Anthony!
Great information in there.

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<AudioSource>().Play();
GetComponent<AudioSource>().volume = Random.Range(0.8f, 1);
GetComponent<AudioSource>().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!

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

Apparently this doesn't like my phone. If you can read it great, otherwise I'll parse it out later when I get home

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. 

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!

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());

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<AudioSource>().clip = myMusic[0] as AudioClip;
}


// Use this for initialization
void Start() {

}


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

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