Skip to content

buffer_read() + buffer_read_into(), do not work with RAW 8-bit (mono) file #475

@vkostas

Description

@vkostas

I open a 8-bit mono wav file using 'RAW' format.
However buffer_read() method has some weird behaviour:

  1. needs the data type (one of the 'float64', 'float32', 'int32', 'int16').

Very odd, given the fact that SoundFile knows EXACTLY the sample bit length, in both RAW (explicitly given by the caller) and automatic detection. So, why the caller must pass the datatype and re-inventing the wheel of the subtype / data type relation? At least make it optional.
PCM_16 is 2 bytes (int16), PCM_32 is 4 bytes (int32), etc.

  1. cannot read an even number of 8-bit MONO frames.

SoundFile instance is created with required parameters (format='RAW', subtype='PCM_U8', channels=1, samplerate='44100').
What's the point of the RAW format if it cannot support 8-bit MONO files? Is it a limitation of the wrapped libsndfile or smth else?
PCM_U8 is a valid subtype. Do I have alternatives?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions