Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] In game sound #90

Open
khushal-banks opened this issue May 7, 2024 · 3 comments
Open

[FEATURE] In game sound #90

khushal-banks opened this issue May 7, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@khushal-banks
Copy link

Is your feature request related to a problem? Please describe.
I want to hear game start/over sound, fight started sound like X vs Y, in fight sounds (dhishum-dhishum), kill sound like KO, character sounds etc

*Describe the solution you'd like
If possible please add pre-recorded sounds and play them in-game at suitable/synchronus time

Describe alternatives you've considered
Nothing considered. If not possible i would play music on my device and enjoy that instead.

Additional context
Pretty much every game has sounds. They are useful in engaging audience and attract their attraction. It would be lovely if helapordo could have this inbuilt or using a third-party tool like mpv cli-player or vlc cli-player

What are your thoughts on this?
Close this whenever you see fit.

Thank you for helapordo.

@khushal-banks khushal-banks added the enhancement New feature or request label May 7, 2024
@jgabaut
Copy link
Owner

jgabaut commented May 7, 2024

Additional context Pretty much every game has sounds. They are useful in engaging audience and attract their attraction.

Yeah, I guess, but pretty much every game is not running inside a terminal. This is a project of passion that does not have that much bulk when it comes to logic code.
Most of the resulting binary space is made up of the animation encoding, which will be updated gradually.

I did a quick check on miniaudio to see how big the single-header lib would be.

$ wc -l miniaudio.h 
92621 miniaudio.h

While this is not a problem per-se, to me it seems supporting sound in any capacity (I don't know if miniaudio would actually suit this use case) needs a lot of support code that I'm simply not willing to pull in right now.

It would be lovely if helapordo could have this inbuilt or using a third-party tool like mpv cli-player or vlc cli-player

I don't know about using a third party tool. You mean attaching a child process running a headless vlc or something?

If it can be made optional end doesn't end up being a nightmare to support and mantain, it sounds interesting. I'm very reluctant to the idea but I want to hear what you were referring to.

Describe alternatives you've considered Nothing considered. If not possible i would play music on my device and enjoy that instead.

This sounds kinda funny. I don't know if you were being serious, that's alright in both cases. 😄

What are your thoughts on this? Close this whenever you see fit.

In general, I don't really think this will be done soon but it is 100% a nice would-be addition to the ncurses build. As for the raylib build, there's raudio which will make this integration much easier (and definitely planned).

If you want to try taking a stab at this, you may expand your ideas. If you have questions, you're welcome to ask.

I think the issue should stay open, since even the raylib build still has no sounds (not that it has anything else of value).

@jgabaut jgabaut self-assigned this May 7, 2024
@khushal-banks
Copy link
Author

I don't know about using a third party tool. You mean attaching a child process running a headless vlc or something?

  • Using something like aplay seems like a great fit.
  • +1 👍 for suggesting child process

If it can be made optional end doesn't end up being a nightmare to support and mantain, it sounds interesting.

If you are open to this and once you finalize the sound files that you want to use, then; let's create a new branch where you initially add calls to empty functions to play selected sounds.
As, only one sound can be played at a time. It would be best if we create separate thread which would in an infinite loop will wait for events from queue.

Queue event be:

  • command (play/stop)
  • file

Commands:

  • for play command this thread would play the file (in a child process like you suggested)
  • for stop command this thread will kill the child process (as this is parent so we have child pid)

@jgabaut
Copy link
Owner

jgabaut commented May 11, 2024

* Using something like [aplay](https://www.geeksforgeeks.org/aplay-command-in-linux-with-examples/) seems like a great fit.

Maybe, I will have to look into the interface for this.

If you are open to this and once you finalize the sound files that you want to use, then; let's create a new branch where you initially add calls to empty functions to play selected sounds. [...]

This is interesting but clearly needs sound (pun intended) internal definitions of what's going on, to be mantainable.

I will have to put this on hold for a while, since the current minor release is already quite burdened and it's the longest break since last minor ever.

I'm gonna try to include some new developments on this on an upcoming dev cycle, but for now I'd just keep the issue open. If you prefer it, I may close as not planned and reopen when the time is right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants