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

Same wave file sounds different on different Mixer voices after upgrading from 4.1.2 to 5.0.0-beta.5 #2634

Open
FoamyGuy opened this issue Feb 19, 2020 · 2 comments

Comments

@FoamyGuy
Copy link
Collaborator

I have this sample code running on a PyGamer:

import board
import audioio
import digitalio
import time

note = audioio.WaveFile(open("c4.wav", "rb"))

audio = audioio.AudioOut(board.SPEAKER)
mixer = audioio.Mixer(voice_count=2, sample_rate=8000,
    channel_count=2, bits_per_sample=16, samples_signed=True)

speaker_en = digitalio.DigitalInOut(board.SPEAKER_ENABLE)
speaker_en.direction = digitalio.Direction.OUTPUT
speaker_en.value = True
audio.play(mixer)

print("playing")
mixer.play(note, voice=0, loop=True)
time.sleep(1.0)
print("stopping")
mixer.stop_voice(0)

time.sleep(1.0)
mixer.play(note, voice=1, loop=True)
time.sleep(1.0)
print("stopping")
mixer.stop_voice(1)

With CP 4.1.2 I hear the same tone played twice out of the two different voices and it sounds the same both times.

With CP 5.0.0-beta.5 the first time the tone plays it sounds "choppy" but the second time it plays clean and sounds just like the ones from 4.1.2.

Playing via the 3.5mm jack vs. the on board speaker does not seem to make any difference.

If I switch it around and play out of voice 1 first and then voice 0 second I still hear choppiness the first time and clean the second. Though the choppiness is not quite as extreme.

I can make recordings and link them here if it is helpful.

The wave file used is here

I have observed similar issues on the NeoTrellis M4 when upgrading from 4.1.2 to 5.0.0-beta5

@FoamyGuy
Copy link
Collaborator Author

Re-tested on 5.0.0 and still get the same results.

@dhalbert dhalbert added the audio label Mar 12, 2020
@dhalbert dhalbert added this to the 5.x.x - Bug Fixes milestone Mar 12, 2020
@FoamyGuy
Copy link
Collaborator Author

I tested this again with 5.4.0.beta1 it has gotten much better but there is still some difference between the two playbacks.

The issues that I believed were similar that I had noticed on the Neotrellis M4 seem to be resolved entirely now. Perhaps they were not as connected as I had thought. #2996 might have been the relavent fix for the issue I saw on the Neotrellis I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants