Photos downloads from Apps instead of shipping in Breeze, practice and guide voice clips move to Ogg Opus, dependencies update (Ziran, Kryon, Apps, Arcade, practices), and the 2.1.63 version and store notes are prepared. The Practice tab note is translated in every locale.
29 lines
1.6 KiB
Ziran
29 lines
1.6 KiB
Ziran
#import, file "../src/app/ogg_length.zi";
|
|
#import "byte_text_linux"
|
|
|
|
// A clip of three pages: the identification header at 16 kHz, a middle page
|
|
// at two seconds and a last page at 116000 samples, 7.25 seconds.
|
|
clip_bytes: [128]u8 = .[79, 103, 103, 83, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 30, 1, 118, 111, 114, 98, 105, 115, 0, 0, 0, 0, 1, 128, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 184, 1, 79, 103, 103, 83, 0, 0, 0, 125, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 4, 97, 98, 99, 100, 79, 103, 103, 83, 0, 4, 32, 197, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, 10, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57];
|
|
|
|
// An Ogg Opus clip of two pages: OpusHead with a 312-sample pre-skip and a
|
|
// last page at granule 96312, so 96000 samples at 48 kHz: 2 seconds.
|
|
opus_bytes: [79]u8 = .[79, 103, 103, 83, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 19, 79, 112, 117, 115, 72, 101, 97, 100, 1, 1, 56, 1, 128, 62, 0, 0, 0, 0, 0, 79, 103, 103, 83, 0, 4, 56, 120, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 4, 97, 98, 99, 100];
|
|
|
|
#program_export
|
|
Answer :: () -> s32 {
|
|
clip := TextFromBytes(clip_bytes[:])
|
|
if OggClipMilliseconds(clip) != 7250 {
|
|
return 1
|
|
}
|
|
// Not a Vorbis clip, too short, or cut before its last page header.
|
|
if OggClipMilliseconds("OggS not a clip at all, just some text that is long enough") != 0 ||
|
|
OggClipMilliseconds("") != 0 ||
|
|
OggClipMilliseconds(TextFromBytes(clip_bytes[0:40])) != 0 {
|
|
return 2
|
|
}
|
|
if OggClipMilliseconds(TextFromBytes(opus_bytes[:])) != 2000 {
|
|
return 3
|
|
}
|
|
return 42
|
|
}
|