Sending Sounds for/in a Turn Based Game

My son and I are creating a turn-based game where you record a sound and “send it” to a second player. That player would have the option to play the sound at their discretion (like a Words With Friends turn) so my question is: is this possible in Unity? I’m having a hard time finding possible solutions and wondering if it’s a simple solution I just can’t see! :slight_smile:

Thanks a ton for any advice…love your site and we’ll be here a lot I’m sure!
-Eli

Hi @grinline !

Sounds like a fun project!
I personally haven’t tried recording sounds in Unity yet, but this might help you on your way:

For recording audio:

Next, for saving the file somewhere:

Hey thanks @blackdragonbe !
I apologize for the delayed reply…was traveling when I posted this and didn’t catch your response for some reason. I’ll definitely check out those links! And if you (or anyone) comes across other ideas or assets I can plug in, let me know!

…If we can pull this off…you get a free copy of the game for sure! :smiley:
Cheers!

I wont speak to whether it’s easy to make a turn-based game. Anything is easy if you know how to do it. Conversely, if you don’t know how, it’s hard.

An essential part of my turn-based game is the GameController class, which checks the game status every frame and reacts based on that. The state (a public static enum) can be set from any class and for a number of reasons. Here is how it goes when the state has been set to switch turns:

case StateType.TURNOVER:
print(“Turn is over!”);
//check if all players controls a goalpost,
//remove those that don’t
if (CurrentPlayerHasLost())
{
print(nowPlaying.name + " does not control any Goalposts, and is removed from the game.“);
GuiBuilder.infoText = nowPlaying.name + " does not control any Goalposts, and is removed from the game.”;
sceneSc.lordList.Remove(nowPlaying.gameObject);
lordList.Remove(nowPlaying);
}

            //Is game over?
            if (sceneSc.lordList.Count < 2)
            {
                SetState(StateType.GAMEOVER, this);
                print("Game is over. " + lordList[0].name + " is Victorious!");
                GuiBuilder.infoText = "Game is over. " + lordList[0].name + " is Victorious!";
            }
            else
            {
                SetState(StateType.STARTTURN, this);
            }

            ChangePlayer(); //Do this from server!
            AddEnergy();
            break;

There’s quite a few things going on here, but I think the gist of it is fairly clear. According to the thread, one function of interest might be ChangePlayer().

private void ChangePlayer()
{
numShots = 0;
numBuys = 0;
timeUsed = 0;

    int index = lordList.IndexOf(nowPlaying);
    if (index >= lordList.Count - 1 || index < 0)
    {
        nowPlaying = lordList[0];
        turn++;
    }
    else
        nowPlaying = lordList[index + 1];
}