hope366 / Lizzie-improvements

Lizzie - Leela Zero Interface
GNU General Public License v3.0
30 stars 9 forks source link

fix play sound in linux or mac #17

Closed sjnam closed 3 years ago

sjnam commented 3 years ago

"Play Sound" dose not work in linux or mac.

hope366 commented 3 years ago

Thank you for your wonderful PR! !! Previously, I had received an opinion from another person that there was no sound on my mac, but I couldn't improve it without my knowledge of programming. I don't have mac or linux, so I'm sorry I can't check the operation. However, for many users of mac and linux, I would like to merge this PR and release it immediately.

hope366 commented 3 years ago

Mac users using Lizzie with this PR have reported that there is still no sound. Is further improvement possible?

sjnam commented 3 years ago

On my mac and linux it sounds fine. I have no problem with sound.

hope366 commented 3 years ago

Is that so ... does that mean that there is a problem with the usage environment of individual users? By the way, the user who has reported the problem says that the problem is that the sound folder is specified as an absolute path, and if this is a relative path, it will work.

sjnam commented 3 years ago

The sound folder and lizzie-improved jar file must be in the same directory.

hope366 commented 3 years ago

The user reporting the bug said:

The error message looks like this: 無題

sjnam commented 3 years ago

No. If a user has a Lizzie with this PR and the sound folder not exist and the user use mac or linux, then she or he has an error message "/sound/Stone.wav" not "\sound\Stone.wav". So, maybe the user does not have a Lizzie with this PR.

hope366 commented 3 years ago

Sorry, my explanation was inadequate. The above error message is from a long time ago (about a year). Naturally, this is when I used lizzie without this PR being used.

hope366 commented 3 years ago

We just received a notice from the person who reported the error. The error was caused by not having the Lizzie directory as the current directory when starting Lizzie. "java -jar lizzie/lizzie-0.7.4-shaded.jar" The error seems to have occurred because of the way it was started. cd lizzie java -jar lizzie-0.7.4-shaded.jar By starting it like this, the sound seems to have come out successfully. I apologize for the extra trouble.

sjnam commented 3 years ago

At last, I understand the situation what you say. You are right, when you start lizzie with "java -jar lizzie/lizzie-0.7.4-shaded.jar", the sound dose not play.

Even though when you lizzie start with the above command, you want the sound play well?

hope366 commented 3 years ago

Yes, if it is possible, I would like to know how it is done.

sjnam commented 3 years ago

The "sound" folder should be located in a directory where "java" command is executed. so, "cd lizzie; java ...." works.

There are two solution I think.

  1. When you start lizzie with java, you should tell the java where sound folder is. for example, "java -jar lizzie-0.7.4-shaded.jar /tmp/sound"
  2. Use fixed absolute path for sound folder. for example "/tmp/sound" and then you hard coded the path name in a source java file.
sjnam commented 3 years ago

IMHO, "Play Sound" is not an important function in a Lizzie. If you don't like my play-sound patch, you can revert it. I don't mind it. :-)

I love your Lizzie-improvements project!

Thank you.

hope366 commented 3 years ago

I am not a computer programmer, I merely compile and provide lizzie. Therefore, people who can program like you are very valuable to me. I would be very happy if you could actively create a pull request for me if you notice anything in the future.

Thank you very much.