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

feat: load sounds with protobuf #1074

Merged
merged 11 commits into from
Jan 28, 2025
Merged

feat: load sounds with protobuf #1074

merged 11 commits into from
Jan 28, 2025

Conversation

Zbizu
Copy link
Contributor

@Zbizu Zbizu commented Jan 24, 2025

Description

This is a continuation of bringing expanded protobuf support to otclient.
This isn't a complete solution but moves us very close to forwarding protobuf soundbanks to the client

These things are "to do", that won't be part of this PR:

  • path detection for ogg files (currently the client only knows the file name)
  • playing sound effects from server packets
  • playing sound effects from items on screen
  • getting the performance right so it doesn't lag when multiple sounds are played

Type of change

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

(note on "breaking" checkbox: current sound files will be moved to another place as data/sounds will work like data/things when I finish this PR)

How Has This Been Tested

(requires "enable audio" option checked)
terminal: g_sounds.play('/sounds/1320/' .. g_sounds.getAudioFileNameById(4))

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I checked the PR checks reports
  • 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

@Zbizu
Copy link
Contributor Author

Zbizu commented Jan 24, 2025

reviews are welcome at every stage of this PR!

@Zbizu Zbizu marked this pull request as ready for review January 24, 2025 14:48
meta.lua Outdated Show resolved Hide resolved
@kokekanon
Copy link
Collaborator

kokekanon commented Jan 24, 2025

versions that do not use protobuf this error is displayed
WARNING: Failed to load '/sounds/860/' (Sounds): unable to open file '/sounds/860/catalog-sound.json': not found

maybe g_game.isUsingProtobuf() in game_things fix that

@Zbizu Zbizu requested a review from kokekanon January 25, 2025 11:50
@Zbizu
Copy link
Contributor Author

Zbizu commented Jan 25, 2025

any more changes needed?

@mehah mehah changed the title load sounds with protobuf feat: load sounds with protobuf Jan 28, 2025
@mehah mehah merged commit 0276a5f into mehah:main Jan 28, 2025
9 of 12 checks passed
@Zbizu Zbizu deleted the sounds branch January 28, 2025 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants