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

Strange sound at iOS #15

Open
cool2apps opened this issue Jun 19, 2024 · 4 comments
Open

Strange sound at iOS #15

cool2apps opened this issue Jun 19, 2024 · 4 comments

Comments

@cool2apps
Copy link

I build a gaming emulator with flutter and sound is working not so bad (but not perfect) at android but the sound is very weird at iOS. What could be the problem? Any idea?

Android:
https://github.com/chipweinberger/flutter_pcm_sound/assets/107851812/8d0482ab-c55f-4895-943a-b64d7ed5dc4b

iOS:
https://github.com/chipweinberger/flutter_pcm_sound/assets/107851812/4515d165-6423-4ba3-a253-f71e24ba24b0

@chipweinberger
Copy link
Owner

chipweinberger commented Jun 19, 2024

the sound is kind of flickery?

no im not sure the cause. make sure you are feeding enough pcm samples regularly.

@masa8
Copy link

masa8 commented Nov 28, 2024

Hi, The same thing is happening to me.
I use cosineWave().
What code gives enough pcm samples?
It would be helpful if you could give us some sample code.

@chipweinberger
Copy link
Owner

there is an example in the repo already

@masa8
Copy link

masa8 commented Nov 28, 2024

Thanks. You are indeed right, cosineWave() was called within generate().
I'm writing the following code to sound a chord,
but it sounds weird only on iOS.
Does this code have sufficient pcm samples?

frames = zip([
                scale.cosineWave(
                    periods: 441, freq: 440.0, volume: 0.2), // Root [C]
                scale.cosineWave(
                    periods: 441,
                    freq: 440.0 * (5 / 4),
                    volume: 0.2), // Major Third [E]
                scale.cosineWave(
                    periods: 441,
                    freq: 440.0 * (3 / 2),
                    volume: 0.2) // Perfect Fifth [G]
              ]).map((values) => values.reduce((a, b) => a + b)).toList();

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