79796920

Date: 2025-10-22 14:57:44
Score: 2.5
Natty:
Report link

after carefully reviewing your java code, I arranged it in a way that it is working.

What was wrong:
- URL: The URL that you are using can be helpful, but it can often give some errors if resource is not found or correctly located. so Instead, we pass new File into getAudioInputStream's constructor and as an path we use that String 'path' from the constructor.
- Exception Handling: Adding Exceptions like UnsupportedAudioFileException can be fine but I would prefer to shorten it.
- Thread: this is important part because audio playing stops if there is no GUI or any Thread because audio is not waiting. For that, we can either use Scanner or Thread.sleep(clip.getMicrosecondLength()/1000);
- Calling: Don't forget to call stop or play method before playing an Audio file at the right place.

If you want full fixed code, Please contact me.

Reasons:
  • Blacklisted phrase (0.5): contact me
  • Blacklisted phrase (1): Please contact me
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: IosebiGames