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

[raudio] Null audio device backend when trying to initialize #4376

Closed
Patchap1 opened this issue Oct 10, 2024 · 8 comments
Closed

[raudio] Null audio device backend when trying to initialize #4376

Patchap1 opened this issue Oct 10, 2024 · 8 comments

Comments

@Patchap1
Copy link

Patchap1 commented Oct 10, 2024

Hello,

I was trying to add sound to my game using Raylib, but I can't hear anything. However, when I look at the console, it says that the sound and the music stream were loaded successfully (I even added code to show 0 if no sound is playing and 1 if a sound is playing). So I’m guessing I’m missing something to be able to hear it, or the sounds I’m using are incompatible. Can someone help me understand the problem, please?

image_2024-10-10_184908841

image

image

@Patchap1 Patchap1 changed the title [module] Short description of the issue/bug/feature PlaySound working but can't hear the sound Oct 10, 2024
@raysan5
Copy link
Owner

raysan5 commented Oct 10, 2024

@Patchap1 Did you try the audio examples? Do they work? If they work then issue could be in your code.
As per the shared code, everything seems fine... except that list of values in the log that I imagine you printf().

@Patchap1
Copy link
Author

What do you mean by audio examples? And regarding the list of values in the log, yes, it is from the printf() function, and you can clearly see a line of 1, which means the sound was played but couldn't be heard.

@raysan5
Copy link
Owner

raysan5 commented Oct 10, 2024

What do you mean by audio examples?

@Patchap1 I mean the raylib audio examples included with the library. If you are on Windows, you can open the provided VS2022 solution and try them.

@gen2brain
Copy link
Contributor

@Patchap1 You have Backend: miniaudio / Null, so with Null backend there is no sound. Try the examples first. What OS is that?

@gen2brain
Copy link
Contributor

You can check two similar issues but on macOS mackron/miniaudio#750 and gen2brain/raylib-go#274. It can also happen on distros with non-standard file system layout because miniaudio will dlopen/runtime link the libraries.

@raysan5
Copy link
Owner

raysan5 commented Oct 12, 2024

It seems the issue is out of scope of raylib and it can rely on OS configuration or miniaudio library.

@raysan5 raysan5 closed this as completed Oct 12, 2024
@raysan5 raysan5 changed the title PlaySound working but can't hear the sound [raudio] Null audio device backend when trying to initialize Oct 12, 2024
@Patchap1
Copy link
Author

Sorry I'm kinda new so I don't know how to use the exemples.
Can you explain please ?

@Patchap1
Copy link
Author

AH ! Nevermind I found the issue, it was because I wasn't including miniaudio.h...

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

No branches or pull requests

3 participants