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

Stuttering on 96 kHz / 24 bit FLAC #132

Open
jericdeleon opened this issue Oct 10, 2021 · 3 comments
Open

Stuttering on 96 kHz / 24 bit FLAC #132

jericdeleon opened this issue Oct 10, 2021 · 3 comments

Comments

@jericdeleon
Copy link

jericdeleon commented Oct 10, 2021

👋 Hello!

First off, thanks for this library! Got it mostly working, but struggling on a certain area.

Whenever I try playing a hi-res FLAC file (96 kHz / 24 bit) following the Beep Tutorial, I encounter stuttering and breaking.

Logging out format from flac.Decode on 2 different FLAC files:

  • File 1 (Precision: 2, Sample Rate: 44100) works without issues
  • File 2 (Precision: 3, Sample Rate: 96000) stutters. Tried fiddling with the resampling quality, without any luck.

Here's a sample file where I can reproduce the stuttering.

It also doesn't help that this is my first time delving into audio processing, so I'm not quite sure if I'm just missing some configuration on how I'm using the lib, or whether this problem exists within faiface/beep, or hajimehoshi/oto, or even just on OSX in general.

Any pointer to the right direction will be highly appreciated.

I am on: MacOS Big Sur 11.6 (let me know if you'd like more environment settings).

@kemokemo
Copy link

First of all, Thank you so much for this awesome product beep!

I just recently started using beep. I am suffering from similar symptoms.
Adjusting the buffer size as shown below improves the symptoms somewhat, but stuttering still occurs.

- speaker.Init(format.SampleRate, format.SampleRate.N(time.Second/10))
+ speaker.Init(format.SampleRate, format.SampleRate.N(time.Second/1000))

development specs

  • macOS Monterey Ver. 12.6
  • go version go1.19.1 darwin/amd64
  • github.com/faiface/beep v1.1.0

@kemokemo
Copy link

Sorry to keep coming back to you.

I noticed the following statement in the README of the oto that beep uses internally.

// Usually 44100 or 48000. Other values might cause distortions in Oto
samplingRate := 44100

I will discuss this with the issue of oto repository to see if they can support a sampling rate of 96000.

@kemokemo
Copy link

kemokemo commented Oct 4, 2022

In my environment and usage, I can playback without noise by changing the buffer size to 20000.
On the other hand, in my Windows environment, I can playback with a buffer size of 10.

Due to my lack of knowledge and research, I cannot explain the reasons for these behaviors. I am thinking of using it anyway, as it seems to accomplish the application at hand.

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

2 participants