Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Unable to play ALAC 24/96 in v1.3.8 (Read 1948 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Unable to play ALAC 24/96 in v1.3.8

Any help? I'm unable to play some apple lossless 24/96 files in foobar. Instead I get the message: Unable to open item for playback (Unsupported format or corrupted file). However, seeing that I can play it on vlc and iTunes, it's unlikely that the file is corrupted. Any way I could solve this? Kinda sucks that I can't add it to a playlist.

Unable to play ALAC 24/96 in v1.3.8

Reply #1
If you install the foo_verify component does it give you better feedback?

Quote
Kinda sucks that I can't add it to a playlist.
You can add unplayable files to a playlist, unless there's something else, more severe going on.
elevatorladylevitateme

Unable to play ALAC 24/96 in v1.3.8

Reply #2
Test 24 bit 96 kHz ALAC files I made all work flawlessly. A sample file that refuses to work should clear things up and help fix possible bugs in foobar2000.

Unable to play ALAC 24/96 in v1.3.8

Reply #3
If you install the foo_verify component does it give you better feedback?

Quote
Kinda sucks that I can't add it to a playlist.
You can add unplayable files to a playlist, unless there's something else, more severe going on.


Thanks for the suggestion. I tried the verifier and it just says Failed: unsupported format or corrupted file.

Also, sorry for the misunderstanding. I am able to add it to the foobar playlist. What I meant was that it was a pity the song couldn't mixed with other songs in a playlist and have a smooth listening session.

Unable to play ALAC 24/96 in v1.3.8

Reply #4
Please consider posting the effected file in our uploads forum, if it's an appropriate size. We'd love to know if it's the file or if the decoder needs to cover your corner case.
elevatorladylevitateme


Unable to play ALAC 24/96 in v1.3.8

Reply #6
Regardless of how it turns out, thanks for the help

Unable to play ALAC 24/96 in v1.3.8

Reply #7
Thanks for the samples. Looks like Peter needs to take a look at the problem.

Unable to play ALAC 24/96 in v1.3.8

Reply #8
It seems that samplerate=0 in the stsd.alac box (class AudioSampleEntry) and fb2k dislikes it.
After editing the field using hex editor to a non-zero value, fb2k could play this file.
(This file also has a strange/buggy stts entry with sample_delta=0 at the end, but it seems to do no harm)

14496-12 defines samplerate field of AudioSampleEntry like this:
Code: [Select]
unsigned int(32) samplerate = { default samplerate of media}<<16;

As you can see, it's effective capacity is limited to 16bit due to the shift (not enough for 96000). I guess the muxer (ffmpeg?) has set this field to zero because of this.
Since actual sample rate or something is contained in the "magic cookie" (ALACSpecificConfig), this field is not important at all for decoding.

Unable to play ALAC 24/96 in v1.3.8

Reply #9
It seems that samplerate=0 in the stsd.alac box (class AudioSampleEntry) and fb2k dislikes it.
After editing the field using hex editor to a non-zero value, fb2k could play this file.
(This file also has a strange/buggy stts entry with sample_delta=0 at the end, but it seems to do no harm)

14496-12 defines samplerate field of AudioSampleEntry like this:
Code: [Select]
unsigned int(32) samplerate = { default samplerate of media}<<16;

As you can see, it's effective capacity is limited to 16bit due to the shift (not enough for 96000). I guess the muxer (ffmpeg?) has set this field to zero because of this.
Since actual sample rate or something is contained in the "magic cookie" (ALACSpecificConfig), this field is not important at all for decoding.



Thanks for the help. Could you explain in simpler or perhaps more specific terms how I might use the hex editor to just that? Unfortunately I'm not that great with stuff like this.

Unable to play ALAC 24/96 in v1.3.8

Reply #10
Thanks for the help. Could you explain in simpler or perhaps more specific terms how I might use the hex editor to just that? Unfortunately I'm not that great with stuff like this.

Well, search for the first occurrence of "alac" and rewrite like this.
From:
Code: [Select]
000001a0: 626c 0000 0058 7374 7364 0000 0000 0000  bl...Xstsd......
000001b0: 0001 0000 0048 616c 6163 0000 0000 0000  .....Halac......
000001c0: 0001 0000 0000 0000 0000 0002 0010 0000  ................
000001d0: 0000 0000 0000 0000 0024 616c 6163 0000  .........$alac..
To:
Code: [Select]
000001a0: 626c 0000 0058 7374 7364 0000 0000 0000  bl...Xstsd......
000001b0: 0001 0000 0048 616c 6163 0000 0000 0000  .....Halac......
000001c0: 0001 0000 0000 0000 0000 0002 0010 0000  ................
000001d0: 0000 ac44 0000 0000 0024 616c 6163 0000  ...D.....$alac..

"0002 0010" after alac is number of channels(2) and bits per sample(16).
skip next 4 byte "0000 0000", and write some arbitrary sample rate (in this example, ac44 == 44100)

However, if you are using Windows, re-encoding with refalac should be a lot easier.

Unable to play ALAC 24/96 in v1.3.8

Reply #11
Both the sample rate and the bit depth are held in the ALAC codec data block.

Unable to play ALAC 24/96 in v1.3.8

Reply #12
Thanks for all the help! Works fine now