Skip to content

Conversation

@thomas-mauran
Copy link
Owner

rust feature to disable sound when building

Description

Right now when we build chess-tui we always have the sound feature enabled.
We now use rust features to build without the rodio setup for the sound.

cargo build --no-default-features

./target/debug/chess-tui

when the sound is disabled we don't play the sound and don't have the menu item

Fixes #175

How Has This Been Tested?

Manual testing

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Signed-off-by: Thomas Mauran <thomasmauran@yahoo.com>
Signed-off-by: Thomas Mauran <thomasmauran@yahoo.com>
@thomas-mauran thomas-mauran self-assigned this Dec 21, 2025
@thomas-mauran thomas-mauran added the enhancement New feature or request label Dec 21, 2025
@thomas-mauran
Copy link
Owner Author

Hello @craftmaster1231 I managed to make the sound feature optional on cargo build this allows anybody to use chess-tui without the sound lib !
looking forward for your feedbacks about that solution

@craftmaster1231
Copy link

craftmaster1231 commented Dec 23, 2025

@thomas-mauran
Didn't tried this branch yet, but I realize that I don't have sounds at all, even after installing pulseaudio-alsa and error messages disappeared.

We had a conversation in #175

@craftmaster1231
Copy link

Do you have a video reference with sounds should be heard?

@thomas-mauran
Copy link
Owner Author

Hello @craftmaster1231
Here is a video with the sound, this is very basic

recorded on mac os after a cargo run

hjkjkh.mp4

@craftmaster1231
Copy link

Got you.
I don't have sounds. Setting on menu says "ON", tried to switch it.

@craftmaster1231
Copy link

Did a build of this branch. Also no sound on it.

@craftmaster1231
Copy link

craftmaster1231 commented Dec 24, 2025

Without pulseaudio-alsa package error messages like in #175 are still here.

@thomas-mauran
Copy link
Owner Author

Hello @craftmaster1231 I'm gonna try to mute the errors in another way. Did you try to build without the sound with the feature disable I mentioned ? This is a first solution to be able to use it without the sound

@craftmaster1231
Copy link

Hello @craftmaster1231 I'm gonna try to mute the errors in another way. Did you try to build without the sound with the feature disable I mentioned ? This is a first solution to be able to use it without the sound.

My bad, I built this branch wrong previously. Error messages are gone. :)
No error messages and no menu item.

Is it possible to use sounds optionally, depending on launch option, not a menu item or even build option?
By the way, on main branch, if I disable the sound in menu option and then restart game, errors are also gone.

@thomas-mauran
Copy link
Owner Author

Hello @craftmaster1231 I'm gonna try to mute the errors in another way. Did you try to build without the sound with the feature disable I mentioned ? This is a first solution to be able to use it without the sound.

Oh this is actually nice, I didn't thought about that as a solution

My bad, I built this branch wrong previously. Error messages are gone. :) No error messages and no menu item.

That's nice ! this offers a way to build the game without bothering with the rodio sound lib

Is it possible to use sounds optionally, depending on launch option, not a menu item or even build option? By the way, on main branch, if I disable the sound in menu option and then restart game, errors are also gone.

If indeed when we disable the sound from the menu and start the game again we dont have any error message I can make a launch option to disable it which is pretty easy !

Doing that asap and pinging you back, thank you for your time and reviews @craftmaster1231

Signed-off-by: Thomas Mauran <thomasmauran@yahoo.com>
@thomas-mauran
Copy link
Owner Author

Hello again @craftmaster1231 I made a --no-sound command available to run chess-tui without the sound on

@thomas-mauran thomas-mauran moved this to In Progress in Chess-tui Dec 29, 2025
@thomas-mauran
Copy link
Owner Author

Hello @craftmaster1231 wondering if you had some time to check this out so I can merge it and release a 2.3.0 ?!

Signed-off-by: Thomas Mauran <thomasmauran@yahoo.com>
@thomas-mauran thomas-mauran merged commit d60fc9d into main Jan 5, 2026
17 checks passed
@thomas-mauran thomas-mauran deleted the fix/sound branch January 5, 2026 10:37
@github-project-automation github-project-automation bot moved this from In Progress to Done in Chess-tui Jan 5, 2026
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

Status: Done

Development

Successfully merging this pull request may close these issues.

Errors written upon menu screen

3 participants