Skip to content

First 512 samples of a source added to an empty Sink are always mono #811

@0----0

Description

@0----0

To reproduce this issue, try following the music_wav example with a 2-channel WAV file with audio within the first ~11ms. Record the audio output and compare with the input. Instead of being the same, the first 11ms of the recorded output should be about double-length and mono (due to the stereo file being read as mono and converted to stereo.)

This seems to be related to the interaction between the mixer's UniformSourceIterator and SourcesQueueOutput, which plays "silence" at 1 channel when there are no sources. In particular, changing the "silence" played by SourcesQueueOutput from 1 channel to 2 channels (by editing my local copy of queue.rs) causes the sound to play normally.

I'm suspicious of the conditional logic on current_span_len -- I wonder if it's transitioning from silence to an actual sound improperly, and returning a span length of THRESHOLD on that borderline. But I can't investigate it right now, so I'll leave this issue here until I get the time to look at it further.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions