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

Krom audio plays with the wrong pitch if the system's sample rate isn't 44100hz #3038

Open
moisesjpelaez opened this issue Aug 28, 2024 · 0 comments
Labels
bug This issue describes a bug

Comments

@moisesjpelaez
Copy link
Contributor

I started this issue here but I found out it was a separate problem.

I have been testing the audio with Krom builds and after reading this in the forums I realized the audio has been playing well with some devices (a bluetooth speaker) but hasn't play well with others (a headphone and laptop's speaker).

Description
Krom builds plays the audio with a different pitch when the system's sound device doesn't match 44100hz, this is because that value is hardcoded in Krom's audio backend. When I manually put my system's audio sample rate on lines 13 and 14 the audio plays with the correct pitch.

This issue could be solved by getting the system's sample rate from the Krom's backend and assign that value when initializing, but I have no idea on how to do that.

To Reproduce
On Windows:

  1. Open 'Sound Settings' from the taskbar
  2. Select current audio device from 'Output'
  3. Verify the frequency
    • if it's 44100hz the audio will reproduce well
    • if it isn't 44100hz the audio will reproduce with a different pitch (in my case most of my audio devices are 48000hz and they play at a higher pitch)

Expected behavior
To play audio with the correct pitch if the system's sample rate is different from 44100hz.

System
Blender: 3.6.11 LTS
Armory: from this commit
OS: Windows 11 Pro (x64)
Graphics card: NVIDIA GeForce RTX 3050 Ti Laptop

Test File
Can be tested with the sound example.

@moisesjpelaez moisesjpelaez added the bug This issue describes a bug label Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue describes a bug
Projects
None yet
Development

No branches or pull requests

1 participant