Ask coding questions

← Back to all posts
A slightly more comprehensive question on audio
Typhlotion (1)

I've made a question regarding audio in a C++ file before, and I barely even knew what I was asking for. Now I at least know what I don't know, and I've got a couple questions.

Before that, i'd like to point out the fact that I've got essentially no experience or knowledge on writing python code - i'm trying to get this working strictly for the sake of enhancing a text-based game project for my game and simulations class based on C++, which I do have fundamental knowledge of. I've also already read (, but the terminology and example code they used flew right over my head (again, 0 knowledge on python).

Now that all of that is out of the way, my questions:

  • What the hell is a pype? Is that just a pipe to python?
  • How would you write to a pype with "/tmp/audio"? What's the syntax?
  • On python, how would you get the code to start playing an audio file on an infinite loop?
  • On python, how would you get the code to abruptly stop playing an audio file on an infinite loop?
    • Is there a way to do the last two without freezing the console (As in, without stopping it so that you could run music and play the game at the same time)? If so, how?
  • Is there a way to play 2 or more sounds at once?
  • Would there be a way to specify what audio file for the python file to play when I call it from C++? If so, how?

In advance, thanks for your time. I know I've got a lot of really newbie questions, but I really wanted to go nuts with this text based game project and punch above my usual level.