Skip to content

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

Open
@FoamyGuy

Description

@FoamyGuy

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions