Code Monkey home page Code Monkey logo

Comments (2)

OneLoneCoder avatar OneLoneCoder commented on August 19, 2024

Hi Gurkan,
Apologies for the late response, I don't check github very frequently. The code sample you have provided does not have the potential to lock up under normal circumstances. This suggests that you could be trying to play a sample with an invalid index. At run time, it has no way of knowing if the ID is invalid, thus playing with memory it shouldn't be.
I dont think this will be a windows mixing issue, but it is difficult to isolate the cause of the lock. There is potential that for trouble if you are manipulating the vector of samples whilst the sound engine is playing.
The sound engine is due for a bit of an overhaul and some documentation soon enough, so thanks for the reminder!
Jx9

from olcpixelgameengine.

gurkanctn avatar gurkanctn commented on August 19, 2024

Hello javidx9, thanks for the reply. I'm not in a hurry at all, life is at a fast pace everywhere. :)

There is potential that for trouble if you are manipulating the vector of samples whilst the sound engine is playing.

Actually, I'm not manipulating the vector of samples at all.

After some debugging, I've noticed that one of my new sound fx files was broken. It cannot be loaded successfully to Sound engine, but can be played on Windows Media Player. I've fixed my problem already (I'm playing a working file).

I've also done some performance test to play SEVERAL SOUNDS SIMULTANEOUSLY and it successfully plays tens of instances of my three sound fx without crashing.

Lesson learned: I'll add some code to validate that all sound files (and sprites) are successfully loaded into the memory.

I guess I was assuming that the PGE would be checking file/data validity and would crash right upon OnUserCreate(). But, no problems! I love the PGE. :)

from olcpixelgameengine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.