mehah / otclient

An alternative tibia client for otserv written in C++20 and Lua, made with a modular system that uses lua scripts for ingame interface and functionality, making otclient flexible and easy to customize
Other
242 stars 177 forks source link

Audio buffer overflows after playing certain amount of sounds. #798

Closed JosensGames closed 1 week ago

JosensGames commented 2 weeks ago

Priority

Low

Area

What happened?

Hello everyone, this is the issue; every time you play a sound, whether in a channel or not, the sound fills up the program's buffer memory until the client crashes, and note that I'm using the last version published in this repository.

In this case, I played an .ogg file and observed how the program's memory becomes saturated. Approximately, when it reaches 400MB and beyond, it will throw the following error when trying to play any sound:

ERROR: unable to refill audio buffer for '/data/sounds/sfx/sfx_skill.ogg': Out of Memory

https://github.com/mehah/otclient/assets/9597129/32fc8675-b38c-41fd-aef5-eeb1b958b425

It is worth noting that I tried a lot of ways through Lua to clear the client's audio buffer, but there was no result, neither with g_sounds.stopAll() nor anything else.

Should we implement a new function to clear the memory of a sound once it stops playing? Or perhaps a similar function in the source code?

What OS are you seeing the problem on?

Windows

Code of Conduct