pdeljanov / Symphonia

Pure Rust multimedia format demuxing, tag reading, and audio decoding library
Mozilla Public License 2.0
2.33k stars 137 forks source link

Cannot read m4a files - no channels found #291

Open tGrothmannFluffy opened 3 months ago

tGrothmannFluffy commented 3 months ago

Hi,

I'm trying to to decode m4a files, but I am not getting any channels in the decoder. track.codec_params.channels is None.

I'm using these features, because I need to be able to decode a lot of file types:

symphonia = { version = "0.5.4", features = [
    "mpa",
    "all-codecs",
    "aiff",
    "alac",
    "adpcm",
    "aac",
    "vorbis",
    "pcm",
    "isomp4",
    "caf",
    "mkv",
    "opt-simd-sse",
    "opt-simd-avx",
    "opt-simd-neon",
    "default",
] }

The files I tried are:

sweeps.zip

tGrothmannFluffy commented 3 months ago

It seems like I can get the number of channels via

let decoded = decoder.decode(&packet)?;
match decoded {
[...]
   AudioBufferRef::S16(buffer) => {
      let num_channels = buffer.spec().channels.iter().count()
[...]

which is not ideal but works.

tGrothmannFluffy commented 3 months ago

Even though I found a solution for now, I'd like to leave this open. Maybe someone can point me to a better way or tell me what I'm doing wrong here.