mirror of
https://github.com/IllusionMan1212/flac-odin.git
synced 2026-10-24 02:12:29 +00:00
some cleanup
This commit is contained in:
+63
-132
@@ -44,146 +44,77 @@ main :: proc() {
|
|||||||
|
|
||||||
fmt.println(flac_data)
|
fmt.println(flac_data)
|
||||||
|
|
||||||
alsa_err = alsa.pcm_set_params(handle, .S16_LE, .RW_INTERLEAVED, u32(flac_data.metadata.channels), flac_data.metadata.sample_rate, 1, 500000)
|
//alsa_err = alsa.pcm_set_params(handle, .S16_LE, .RW_INTERLEAVED, u32(flac_data.metadata.channels), flac_data.metadata.sample_rate, 1, 500000)
|
||||||
if alsa_err < 0 {
|
|
||||||
fmt.eprintln("Playback open error:", alsa.strerror(alsa_err))
|
|
||||||
os.exit(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
sample_rate := flac_data.metadata.sample_rate
|
|
||||||
channels := flac_data.metadata.channels
|
|
||||||
|
|
||||||
//md5_ctx: md5.Context
|
|
||||||
//md5.init(&md5_ctx)
|
|
||||||
for {
|
|
||||||
frame, err := flac.read_next_frame(reader, flac_data)
|
|
||||||
|
|
||||||
defer delete(frame.samples)
|
|
||||||
if err != nil {
|
|
||||||
if err == .EOF {
|
|
||||||
break
|
|
||||||
} else {
|
|
||||||
fmt.println("Error while decoding frame:", err)
|
|
||||||
os.exit(1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//if frame.sample_rate != sample_rate || frame.channels != channels {
|
|
||||||
// sample_rate = frame.sample_rate
|
|
||||||
// channels = frame.channels
|
|
||||||
// alsa_err = alsa.pcm_set_params(handle, .S16_LE, .RW_INTERLEAVED, u32(channels), sample_rate, 1, 0)
|
|
||||||
//if alsa_err < 0 {
|
//if alsa_err < 0 {
|
||||||
// fmt.eprintln("Playback open error:", alsa.strerror(alsa_err))
|
// fmt.eprintln("Playback open error:", alsa.strerror(alsa_err))
|
||||||
// os.exit(1)
|
// os.exit(1)
|
||||||
//}
|
//}
|
||||||
//}
|
|
||||||
|
|
||||||
//converted_samples := make([]u8, len(samples))
|
//sample_rate := flac_data.metadata.sample_rate
|
||||||
//defer delete(converted_samples)
|
//channels := flac_data.metadata.channels
|
||||||
//for sample, i in samples {
|
|
||||||
// converted_samples[i] = u8(sample & 0xFF)
|
|
||||||
//}
|
|
||||||
|
|
||||||
converted_samples := make([]i16, len(frame.samples))
|
////md5_ctx: md5.Context
|
||||||
defer delete(converted_samples)
|
////md5.init(&md5_ctx)
|
||||||
for sample, i in frame.samples {
|
//for {
|
||||||
new_sample := sample & 0xFF
|
// frame, err := flac.read_next_frame(reader, flac_data)
|
||||||
new_sample |= ((sample >> 8) & 0xFF) << 8
|
|
||||||
converted_samples[i] = i16(new_sample)
|
|
||||||
}
|
|
||||||
|
|
||||||
frames := alsa.pcm_writei(handle, raw_data(converted_samples), u64(len(frame.samples)) / u64(frame.channels))
|
// defer delete(frame.samples)
|
||||||
if frames < 0 {
|
// if err != nil {
|
||||||
fmt.eprintln("Error writing to PCM device:", alsa.strerror(auto_cast frames))
|
// if err == .EOF {
|
||||||
break
|
// break
|
||||||
}
|
// } else {
|
||||||
fmt.printfln("Played %d frames", frames)
|
// fmt.println("Error while decoding frame:", err)
|
||||||
|
|
||||||
//flac.md5hash(&md5_ctx, flac_data.metadata.bits_per_sample, samples)
|
|
||||||
}
|
|
||||||
end := time.now()
|
|
||||||
|
|
||||||
//err = flac.md5sum(&md5_ctx, flac_data)
|
|
||||||
//if err == .MD5_Mismatch {
|
|
||||||
// fmt.println("Decoded audio data is not correct.")
|
|
||||||
// os.exit(1)
|
// os.exit(1)
|
||||||
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
alsa_err = alsa.pcm_drain(handle)
|
// //if frame.sample_rate != sample_rate || frame.channels != channels {
|
||||||
if alsa_err < 0 {
|
// // sample_rate = frame.sample_rate
|
||||||
fmt.eprintln("pcm_drain failed with:", alsa.strerror(alsa_err))
|
// // channels = frame.channels
|
||||||
}
|
// // alsa_err = alsa.pcm_set_params(handle, .S16_LE, .RW_INTERLEAVED, u32(channels), sample_rate, 1, 0)
|
||||||
alsa.pcm_close(handle)
|
// // if alsa_err < 0 {
|
||||||
|
// // fmt.eprintln("Playback open error:", alsa.strerror(alsa_err))
|
||||||
elapsed := time.diff(start, end)
|
// // os.exit(1)
|
||||||
fmt.println("Decoding took", elapsed)
|
// // }
|
||||||
}
|
// //}
|
||||||
|
|
||||||
old_main :: proc() {
|
// //converted_samples := make([]u8, len(samples))
|
||||||
if len(os.args) < 2 {
|
// //defer delete(converted_samples)
|
||||||
fmt.eprintln("Please provide a path to a flac file.")
|
// //for sample, i in samples {
|
||||||
os.exit(1)
|
// // converted_samples[i] = u8(sample & 0xFF)
|
||||||
}
|
// //}
|
||||||
|
|
||||||
handle: ^alsa.pcm_t
|
// converted_samples := make([]i16, len(frame.samples))
|
||||||
|
// defer delete(converted_samples)
|
||||||
arena: virtual.Arena
|
// for sample, i in frame.samples {
|
||||||
arena_err := virtual.arena_init_growing(&arena, mem.Megabyte * 8)
|
// new_sample := sample & 0xFF
|
||||||
if arena_err != nil {
|
// new_sample |= ((sample >> 8) & 0xFF) << 8
|
||||||
fmt.eprintln("Failed to alloc memory")
|
// converted_samples[i] = i16(new_sample)
|
||||||
return
|
// }
|
||||||
}
|
|
||||||
allocator := virtual.arena_allocator(&arena)
|
// frames := alsa.pcm_writei(handle, raw_data(converted_samples), u64(len(frame.samples)) / u64(frame.channels))
|
||||||
|
// if frames < 0 {
|
||||||
alsa_err := alsa.pcm_open(&handle, DEVICE, .PLAYBACK, .BLOCK)
|
// fmt.eprintln("Error writing to PCM device:", alsa.strerror(auto_cast frames))
|
||||||
if alsa_err < 0 {
|
// break
|
||||||
fmt.eprintln("Failed to initialize audio device: ", alsa.strerror(alsa_err))
|
// }
|
||||||
os.exit(1)
|
// fmt.printfln("Played %d frames", frames)
|
||||||
}
|
|
||||||
|
// //flac.md5hash(&md5_ctx, flac_data.metadata.bits_per_sample, samples)
|
||||||
start := time.now()
|
//}
|
||||||
flac_data, err := flac.load_from_file(os.args[1], allocator = allocator)
|
//end := time.now()
|
||||||
if err != nil {
|
|
||||||
fmt.eprintln(err)
|
////err = flac.md5sum(&md5_ctx, flac_data)
|
||||||
if err == .MD5_Mismatch {
|
////if err == .MD5_Mismatch {
|
||||||
fmt.printfln("Expected: %v, got: %v", flac_data.metadata.expected_md5, flac_data.metadata.calculated_md5)
|
//// fmt.println("Decoded audio data is not correct.")
|
||||||
}
|
//// os.exit(1)
|
||||||
os.exit(1)
|
////}
|
||||||
}
|
|
||||||
defer flac.destroy(flac_data, allocator = allocator)
|
//alsa_err = alsa.pcm_drain(handle)
|
||||||
end := time.now()
|
//if alsa_err < 0 {
|
||||||
|
// fmt.eprintln("pcm_drain failed with:", alsa.strerror(alsa_err))
|
||||||
fmt.println(flac_data.metadata)
|
//}
|
||||||
|
//alsa.pcm_close(handle)
|
||||||
alsa_err = alsa.pcm_set_params(handle, .S16_LE, .RW_INTERLEAVED, u32(flac_data.metadata.channels), flac_data.metadata.sample_rate, 1, 500000)
|
|
||||||
if alsa_err < 0 {
|
//elapsed := time.diff(start, end)
|
||||||
fmt.eprintln("Playback open error:", alsa.strerror(alsa_err))
|
//fmt.println("Decoding took", elapsed)
|
||||||
os.exit(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
converted_samples := make([]i16, len(flac_data.samples))
|
|
||||||
|
|
||||||
for sample, i in flac_data.samples {
|
|
||||||
new_sample := sample & 0xFF
|
|
||||||
new_sample |= ((sample >> 8) & 0xFF) << 8
|
|
||||||
converted_samples[i] = i16(new_sample)
|
|
||||||
}
|
|
||||||
|
|
||||||
for {
|
|
||||||
frames := alsa.pcm_writei(handle, raw_data(converted_samples), u64(len(flac_data.samples)) / u64(flac_data.metadata.channels))
|
|
||||||
if frames < 0 {
|
|
||||||
fmt.eprintln("Error writing to PCM device:", alsa.strerror(auto_cast frames))
|
|
||||||
break
|
|
||||||
}
|
|
||||||
fmt.printfln("Played %d frames", frames)
|
|
||||||
}
|
|
||||||
|
|
||||||
alsa_err = alsa.pcm_drain(handle)
|
|
||||||
if alsa_err < 0 {
|
|
||||||
fmt.eprintln("pcm_drain failed with:", alsa.strerror(alsa_err))
|
|
||||||
}
|
|
||||||
alsa.pcm_close(handle)
|
|
||||||
|
|
||||||
elapsed := time.diff(start, end)
|
|
||||||
fmt.println("Decoding took", elapsed)
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import "shared:flac"
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
test_blocksize_4096 :: proc(t: ^testing.T) {
|
test_blocksize_4096 :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/01 - blocksize 4096.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/01 - blocksize 4096.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("Blocksize 4096 Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("Blocksize 4096 Failed with error:", err))
|
||||||
@@ -16,7 +15,6 @@ test_blocksize_4096 :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
test_blocksize_4608 :: proc(t: ^testing.T) {
|
test_blocksize_4608 :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/02 - blocksize 4608.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/02 - blocksize 4608.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("Blocksize 4608 Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("Blocksize 4608 Failed with error:", err))
|
||||||
@@ -25,7 +23,6 @@ test_blocksize_4608 :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
test_blocksize_16 :: proc(t: ^testing.T) {
|
test_blocksize_16 :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/03 - blocksize 16.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/03 - blocksize 16.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("Blocksize 16 Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("Blocksize 16 Failed with error:", err))
|
||||||
@@ -34,7 +31,6 @@ test_blocksize_16 :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
test_blocksize_192 :: proc(t: ^testing.T) {
|
test_blocksize_192 :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/04 - blocksize 192.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/04 - blocksize 192.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("Blocksize 192 Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("Blocksize 192 Failed with error:", err))
|
||||||
@@ -43,7 +39,6 @@ test_blocksize_192 :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
test_blocksize_254 :: proc(t: ^testing.T) {
|
test_blocksize_254 :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/05 - blocksize 254.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/05 - blocksize 254.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("Blocksize 254 Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("Blocksize 254 Failed with error:", err))
|
||||||
@@ -52,7 +47,6 @@ test_blocksize_254 :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
test_blocksize_512 :: proc(t: ^testing.T) {
|
test_blocksize_512 :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/06 - blocksize 512.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/06 - blocksize 512.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("Blocksize 512 Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("Blocksize 512 Failed with error:", err))
|
||||||
@@ -61,7 +55,6 @@ test_blocksize_512 :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
test_blocksize_725 :: proc(t: ^testing.T) {
|
test_blocksize_725 :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/07 - blocksize 725.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/07 - blocksize 725.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("Blocksize 725 Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("Blocksize 725 Failed with error:", err))
|
||||||
@@ -70,7 +63,6 @@ test_blocksize_725 :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
test_blocksize_1000 :: proc(t: ^testing.T) {
|
test_blocksize_1000 :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/08 - blocksize 1000.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/08 - blocksize 1000.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("Blocksize 1000 Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("Blocksize 1000 Failed with error:", err))
|
||||||
@@ -79,7 +71,6 @@ test_blocksize_1000 :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
test_blocksize_1937 :: proc(t: ^testing.T) {
|
test_blocksize_1937 :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/09 - blocksize 1937.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/09 - blocksize 1937.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("Blocksize 1937 Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("Blocksize 1937 Failed with error:", err))
|
||||||
@@ -88,7 +79,6 @@ test_blocksize_1937 :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
test_blocksize_2304 :: proc(t: ^testing.T) {
|
test_blocksize_2304 :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/10 - blocksize 2304.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/10 - blocksize 2304.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("Blocksize 2304 Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("Blocksize 2304 Failed with error:", err))
|
||||||
@@ -97,7 +87,6 @@ test_blocksize_2304 :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
test_partition_order_8 :: proc(t: ^testing.T) {
|
test_partition_order_8 :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/11 - partition order 8.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/11 - partition order 8.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("Partition order 8 Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("Partition order 8 Failed with error:", err))
|
||||||
@@ -106,7 +95,6 @@ test_partition_order_8 :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
test_qlp_precision_15_bit :: proc(t: ^testing.T) {
|
test_qlp_precision_15_bit :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/12 - qlp precision 15 bit.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/12 - qlp precision 15 bit.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("qlp precision 15 bit Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("qlp precision 15 bit Failed with error:", err))
|
||||||
@@ -115,7 +103,6 @@ test_qlp_precision_15_bit :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
test_qlp_precision_2_bit :: proc(t: ^testing.T) {
|
test_qlp_precision_2_bit :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/13 - qlp precision 2 bit.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/13 - qlp precision 2 bit.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("qlp precision 2 bit Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("qlp precision 2 bit Failed with error:", err))
|
||||||
@@ -124,7 +111,6 @@ test_qlp_precision_2_bit :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
wasted_bits :: proc(t: ^testing.T) {
|
wasted_bits :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/14 - wasted bits.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/14 - wasted bits.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("Wasted bits Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("Wasted bits Failed with error:", err))
|
||||||
@@ -133,7 +119,6 @@ wasted_bits :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
only_verbatim_subframes :: proc(t: ^testing.T) {
|
only_verbatim_subframes :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/15 - only verbatim subframes.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/15 - only verbatim subframes.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("Only verbatim subframes Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("Only verbatim subframes Failed with error:", err))
|
||||||
@@ -142,7 +127,6 @@ only_verbatim_subframes :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
partition_order_8_containing_escaped_partitions :: proc(t: ^testing.T) {
|
partition_order_8_containing_escaped_partitions :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/16 - partition order 8 containing escaped partitions.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/16 - partition order 8 containing escaped partitions.flac")
|
||||||
|
|
||||||
testing.expect(
|
testing.expect(
|
||||||
@@ -155,7 +139,6 @@ partition_order_8_containing_escaped_partitions :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
all_fixed_orders :: proc(t: ^testing.T) {
|
all_fixed_orders :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/17 - all fixed orders.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/17 - all fixed orders.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("All fixed orders Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("All fixed orders Failed with error:", err))
|
||||||
@@ -164,7 +147,6 @@ all_fixed_orders :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
precision_search :: proc(t: ^testing.T) {
|
precision_search :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/18 - precision search.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/18 - precision search.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("Precision search Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("Precision search Failed with error:", err))
|
||||||
@@ -173,7 +155,6 @@ precision_search :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
samplerate_35467Hz :: proc(t: ^testing.T) {
|
samplerate_35467Hz :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/19 - samplerate 35467Hz.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/19 - samplerate 35467Hz.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("Samplerate 35467Hz Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("Samplerate 35467Hz Failed with error:", err))
|
||||||
@@ -182,7 +163,6 @@ samplerate_35467Hz :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
samplerate_39kHz :: proc(t: ^testing.T) {
|
samplerate_39kHz :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/20 - samplerate 39kHz.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/20 - samplerate 39kHz.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("Samplerate 39kHz Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("Samplerate 39kHz Failed with error:", err))
|
||||||
@@ -191,7 +171,6 @@ samplerate_39kHz :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
samplerate_22050Hz :: proc(t: ^testing.T) {
|
samplerate_22050Hz :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/21 - samplerate 22050Hz.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/21 - samplerate 22050Hz.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("Samplerate 22050Hz Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("Samplerate 22050Hz Failed with error:", err))
|
||||||
@@ -200,7 +179,6 @@ samplerate_22050Hz :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
_12_bit_per_sample :: proc(t: ^testing.T) {
|
_12_bit_per_sample :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/22 - 12 bit per sample.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/22 - 12 bit per sample.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("12 bit per sample Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("12 bit per sample Failed with error:", err))
|
||||||
@@ -209,7 +187,6 @@ _12_bit_per_sample :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
_8_bit_per_sample :: proc(t: ^testing.T) {
|
_8_bit_per_sample :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/23 - 8 bit per sample.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/23 - 8 bit per sample.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("8 bit per sample Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("8 bit per sample Failed with error:", err))
|
||||||
@@ -218,7 +195,6 @@ _8_bit_per_sample :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
variable_blocksize_file_created_with_flake_revision_264 :: proc(t: ^testing.T) {
|
variable_blocksize_file_created_with_flake_revision_264 :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file(
|
data, err := flac.load_from_file(
|
||||||
"flac-test-files/subset/24 - variable blocksize file created with flake revision 264.flac",
|
"flac-test-files/subset/24 - variable blocksize file created with flake revision 264.flac",
|
||||||
)
|
)
|
||||||
@@ -233,7 +209,6 @@ variable_blocksize_file_created_with_flake_revision_264 :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
variable_blocksize_file_created_with_flake_revision_264_modified_to_create_smaller_blocks :: proc(t: ^testing.T) {
|
variable_blocksize_file_created_with_flake_revision_264_modified_to_create_smaller_blocks :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file(
|
data, err := flac.load_from_file(
|
||||||
"flac-test-files/subset/25 - variable blocksize file created with flake revision 264, modified to create smaller blocks.flac",
|
"flac-test-files/subset/25 - variable blocksize file created with flake revision 264, modified to create smaller blocks.flac",
|
||||||
)
|
)
|
||||||
@@ -251,7 +226,6 @@ variable_blocksize_file_created_with_flake_revision_264_modified_to_create_small
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
variable_blocksize_file_created_with_CUETools_Flake_2_1_6 :: proc(t: ^testing.T) {
|
variable_blocksize_file_created_with_CUETools_Flake_2_1_6 :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file(
|
data, err := flac.load_from_file(
|
||||||
"flac-test-files/subset/26 - variable blocksize file created with CUETools.Flake 2.1.6.flac",
|
"flac-test-files/subset/26 - variable blocksize file created with CUETools.Flake 2.1.6.flac",
|
||||||
)
|
)
|
||||||
@@ -266,7 +240,6 @@ variable_blocksize_file_created_with_CUETools_Flake_2_1_6 :: proc(t: ^testing.T)
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
old_format_variable_blocksize_file_created_with_Flake_0_11 :: proc(t: ^testing.T) {
|
old_format_variable_blocksize_file_created_with_Flake_0_11 :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file(
|
data, err := flac.load_from_file(
|
||||||
"flac-test-files/subset/27 - old format variable blocksize file created with Flake 0.11.flac",
|
"flac-test-files/subset/27 - old format variable blocksize file created with Flake 0.11.flac",
|
||||||
)
|
)
|
||||||
@@ -281,7 +254,6 @@ old_format_variable_blocksize_file_created_with_Flake_0_11 :: proc(t: ^testing.T
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
high_resolution_audio_default_settings :: proc(t: ^testing.T) {
|
high_resolution_audio_default_settings :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/28 - high resolution audio, default settings.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/28 - high resolution audio, default settings.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("High resolution audio, default settings Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("High resolution audio, default settings Failed with error:", err))
|
||||||
@@ -290,7 +262,6 @@ high_resolution_audio_default_settings :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
high_resolution_audio_blocksize_16384 :: proc(t: ^testing.T) {
|
high_resolution_audio_blocksize_16384 :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/29 - high resolution audio, blocksize 16384.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/29 - high resolution audio, blocksize 16384.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("High resolution audio, blocksize 16384 Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("High resolution audio, blocksize 16384 Failed with error:", err))
|
||||||
@@ -299,7 +270,6 @@ high_resolution_audio_blocksize_16384 :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
high_resolution_audio_blocksize_13456 :: proc(t: ^testing.T) {
|
high_resolution_audio_blocksize_13456 :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/30 - high resolution audio, blocksize 13456.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/30 - high resolution audio, blocksize 13456.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("High resolution audio, blocksize 13456 Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("High resolution audio, blocksize 13456 Failed with error:", err))
|
||||||
@@ -308,7 +278,6 @@ high_resolution_audio_blocksize_13456 :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
high_resolution_audio_using_only_32nd_order_predictors :: proc(t: ^testing.T) {
|
high_resolution_audio_using_only_32nd_order_predictors :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file(
|
data, err := flac.load_from_file(
|
||||||
"flac-test-files/subset/31 - high resolution audio, using only 32nd order predictors.flac",
|
"flac-test-files/subset/31 - high resolution audio, using only 32nd order predictors.flac",
|
||||||
)
|
)
|
||||||
@@ -323,7 +292,6 @@ high_resolution_audio_using_only_32nd_order_predictors :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
high_resolution_audio_partition_order_8_containing_escaped_partitions :: proc(t: ^testing.T) {
|
high_resolution_audio_partition_order_8_containing_escaped_partitions :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file(
|
data, err := flac.load_from_file(
|
||||||
"flac-test-files/subset/32 - high resolution audio, partition order 8 containing escaped partitions.flac",
|
"flac-test-files/subset/32 - high resolution audio, partition order 8 containing escaped partitions.flac",
|
||||||
)
|
)
|
||||||
@@ -338,7 +306,6 @@ high_resolution_audio_partition_order_8_containing_escaped_partitions :: proc(t:
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
samplerate_192kHz :: proc(t: ^testing.T) {
|
samplerate_192kHz :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/33 - samplerate 192kHz.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/33 - samplerate 192kHz.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("Samplerate 192kHz Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("Samplerate 192kHz Failed with error:", err))
|
||||||
@@ -347,7 +314,6 @@ samplerate_192kHz :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
samplerate_192kHz_using_only_32nd_order_predictors :: proc(t: ^testing.T) {
|
samplerate_192kHz_using_only_32nd_order_predictors :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/34 - samplerate 192kHz, using only 32nd order predictors.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/34 - samplerate 192kHz, using only 32nd order predictors.flac")
|
||||||
|
|
||||||
testing.expect(
|
testing.expect(
|
||||||
@@ -360,7 +326,6 @@ samplerate_192kHz_using_only_32nd_order_predictors :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
samplerate_134560Hz :: proc(t: ^testing.T) {
|
samplerate_134560Hz :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/35 - samplerate 134560Hz.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/35 - samplerate 134560Hz.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("Samplerate 134560Hz Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("Samplerate 134560Hz Failed with error:", err))
|
||||||
@@ -369,7 +334,6 @@ samplerate_134560Hz :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
samplerate_384kHz :: proc(t: ^testing.T) {
|
samplerate_384kHz :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/36 - samplerate 384kHz.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/36 - samplerate 384kHz.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("Samplerate 384kHz Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("Samplerate 384kHz Failed with error:", err))
|
||||||
@@ -378,7 +342,6 @@ samplerate_384kHz :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
_20_bit_per_sample :: proc(t: ^testing.T) {
|
_20_bit_per_sample :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/37 - 20 bit per sample.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/37 - 20 bit per sample.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("20 bit per sample Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("20 bit per sample Failed with error:", err))
|
||||||
@@ -387,7 +350,6 @@ _20_bit_per_sample :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
_3_channels :: proc(t: ^testing.T) {
|
_3_channels :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/38 - 3 channels (3.0).flac")
|
data, err := flac.load_from_file("flac-test-files/subset/38 - 3 channels (3.0).flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("3 channels Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("3 channels Failed with error:", err))
|
||||||
@@ -396,7 +358,6 @@ _3_channels :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
_4_channels :: proc(t: ^testing.T) {
|
_4_channels :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/39 - 4 channels (4.0).flac")
|
data, err := flac.load_from_file("flac-test-files/subset/39 - 4 channels (4.0).flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("4 channels Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("4 channels Failed with error:", err))
|
||||||
@@ -405,7 +366,6 @@ _4_channels :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
_5_channels :: proc(t: ^testing.T) {
|
_5_channels :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/40 - 5 channels (5.0).flac")
|
data, err := flac.load_from_file("flac-test-files/subset/40 - 5 channels (5.0).flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("5 channels Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("5 channels Failed with error:", err))
|
||||||
@@ -414,7 +374,6 @@ _5_channels :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
_6_channels :: proc(t: ^testing.T) {
|
_6_channels :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/41 - 6 channels (5.1).flac")
|
data, err := flac.load_from_file("flac-test-files/subset/41 - 6 channels (5.1).flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("6 channels Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("6 channels Failed with error:", err))
|
||||||
@@ -423,7 +382,6 @@ _6_channels :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
_7_channels :: proc(t: ^testing.T) {
|
_7_channels :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/42 - 7 channels (6.1).flac")
|
data, err := flac.load_from_file("flac-test-files/subset/42 - 7 channels (6.1).flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("7 channels Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("7 channels Failed with error:", err))
|
||||||
@@ -432,7 +390,6 @@ _7_channels :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
_8_channels :: proc(t: ^testing.T) {
|
_8_channels :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/43 - 8 channels (7.1).flac")
|
data, err := flac.load_from_file("flac-test-files/subset/43 - 8 channels (7.1).flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("8 channels Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("8 channels Failed with error:", err))
|
||||||
@@ -441,7 +398,6 @@ _8_channels :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
_8_channel_surround_192kHz_24_bit_using_only_32nd_order_predictors :: proc(t: ^testing.T) {
|
_8_channel_surround_192kHz_24_bit_using_only_32nd_order_predictors :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file(
|
data, err := flac.load_from_file(
|
||||||
"flac-test-files/subset/44 - 8-channel surround, 192kHz, 24 bit, using only 32nd order predictors.flac",
|
"flac-test-files/subset/44 - 8-channel surround, 192kHz, 24 bit, using only 32nd order predictors.flac",
|
||||||
)
|
)
|
||||||
@@ -456,7 +412,6 @@ _8_channel_surround_192kHz_24_bit_using_only_32nd_order_predictors :: proc(t: ^t
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
no_total_number_of_samples :: proc(t: ^testing.T) {
|
no_total_number_of_samples :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/45 - no total number of samples set.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/45 - no total number of samples set.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("No total number of samples Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("No total number of samples Failed with error:", err))
|
||||||
@@ -465,7 +420,6 @@ no_total_number_of_samples :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
no_min_max_framesize :: proc(t: ^testing.T) {
|
no_min_max_framesize :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/46 - no min-max framesize set.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/46 - no min-max framesize set.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("No min-max framesize Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("No min-max framesize Failed with error:", err))
|
||||||
@@ -474,7 +428,6 @@ no_min_max_framesize :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
only_streaminfo :: proc(t: ^testing.T) {
|
only_streaminfo :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/47 - only STREAMINFO.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/47 - only STREAMINFO.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("Only STREAMINFO Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("Only STREAMINFO Failed with error:", err))
|
||||||
@@ -483,7 +436,6 @@ only_streaminfo :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
extreme_large_seektable :: proc(t: ^testing.T) {
|
extreme_large_seektable :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/48 - Extremely large SEEKTABLE.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/48 - Extremely large SEEKTABLE.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("Extremely large SEEKTABLE Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("Extremely large SEEKTABLE Failed with error:", err))
|
||||||
@@ -492,7 +444,6 @@ extreme_large_seektable :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
extreme_large_padding :: proc(t: ^testing.T) {
|
extreme_large_padding :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/49 - Extremely large PADDING.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/49 - Extremely large PADDING.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("Extremely large PADDING Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("Extremely large PADDING Failed with error:", err))
|
||||||
@@ -501,7 +452,6 @@ extreme_large_padding :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
extreme_large_picture :: proc(t: ^testing.T) {
|
extreme_large_picture :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/50 - Extremely large PICTURE.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/50 - Extremely large PICTURE.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("Extremely large PICTURE Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("Extremely large PICTURE Failed with error:", err))
|
||||||
@@ -510,7 +460,6 @@ extreme_large_picture :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
extreme_large_vorbiscomment :: proc(t: ^testing.T) {
|
extreme_large_vorbiscomment :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/51 - Extremely large VORBISCOMMENT.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/51 - Extremely large VORBISCOMMENT.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("Extremely large VORBISCOMMENT Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("Extremely large VORBISCOMMENT Failed with error:", err))
|
||||||
@@ -519,7 +468,6 @@ extreme_large_vorbiscomment :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
extreme_large_application :: proc(t: ^testing.T) {
|
extreme_large_application :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/52 - Extremely large APPLICATION.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/52 - Extremely large APPLICATION.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("Extremely large APPLICATION Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("Extremely large APPLICATION Failed with error:", err))
|
||||||
@@ -528,7 +476,6 @@ extreme_large_application :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
cuesheet_with_very_many_indexes :: proc(t: ^testing.T) {
|
cuesheet_with_very_many_indexes :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/53 - CUESHEET with very many indexes.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/53 - CUESHEET with very many indexes.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("CUESHEET with very many indexes Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("CUESHEET with very many indexes Failed with error:", err))
|
||||||
@@ -537,7 +484,6 @@ cuesheet_with_very_many_indexes :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
_1000x_repeating_vorbiscomment :: proc(t: ^testing.T) {
|
_1000x_repeating_vorbiscomment :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/54 - 1000x repeating VORBISCOMMENT.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/54 - 1000x repeating VORBISCOMMENT.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("1000x repeating VORBSICOMMENT Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("1000x repeating VORBSICOMMENT Failed with error:", err))
|
||||||
@@ -546,7 +492,6 @@ _1000x_repeating_vorbiscomment :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
file_48_53_combined :: proc(t: ^testing.T) {
|
file_48_53_combined :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/55 - file 48-53 combined.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/55 - file 48-53 combined.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("File 48-53 combined Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("File 48-53 combined Failed with error:", err))
|
||||||
@@ -555,7 +500,6 @@ file_48_53_combined :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
jpg_picture :: proc(t: ^testing.T) {
|
jpg_picture :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/56 - JPG PICTURE.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/56 - JPG PICTURE.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("JPG PICTURE Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("JPG PICTURE Failed with error:", err))
|
||||||
@@ -564,7 +508,6 @@ jpg_picture :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
png_picture :: proc(t: ^testing.T) {
|
png_picture :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/57 - PNG PICTURE.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/57 - PNG PICTURE.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("PNG PICTURE Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("PNG PICTURE Failed with error:", err))
|
||||||
@@ -573,7 +516,6 @@ png_picture :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
gif_picture :: proc(t: ^testing.T) {
|
gif_picture :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/58 - GIF PICTURE.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/58 - GIF PICTURE.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("GIF PICTURE Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("GIF PICTURE Failed with error:", err))
|
||||||
@@ -582,7 +524,6 @@ gif_picture :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
avif_picture :: proc(t: ^testing.T) {
|
avif_picture :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/59 - AVIF PICTURE.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/59 - AVIF PICTURE.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("AVIF PICTURE Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("AVIF PICTURE Failed with error:", err))
|
||||||
@@ -591,7 +532,6 @@ avif_picture :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
mono_audio :: proc(t: ^testing.T) {
|
mono_audio :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/60 - mono audio.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/60 - mono audio.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("Mono audio Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("Mono audio Failed with error:", err))
|
||||||
@@ -600,7 +540,6 @@ mono_audio :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
predictor_overflow_check_16_bit :: proc(t: ^testing.T) {
|
predictor_overflow_check_16_bit :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/61 - predictor overflow check, 16-bit.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/61 - predictor overflow check, 16-bit.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("Predictor overflow check, 16-bit Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("Predictor overflow check, 16-bit Failed with error:", err))
|
||||||
@@ -609,7 +548,6 @@ predictor_overflow_check_16_bit :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
predictor_overflow_check_20_bit :: proc(t: ^testing.T) {
|
predictor_overflow_check_20_bit :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/62 - predictor overflow check, 20-bit.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/62 - predictor overflow check, 20-bit.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("Predictor overflow check, 20-bit Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("Predictor overflow check, 20-bit Failed with error:", err))
|
||||||
@@ -618,7 +556,6 @@ predictor_overflow_check_20_bit :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
predictor_overflow_check_24_bit :: proc(t: ^testing.T) {
|
predictor_overflow_check_24_bit :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/63 - predictor overflow check, 24-bit.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/63 - predictor overflow check, 24-bit.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("Predictor overflow check, 24-bit Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("Predictor overflow check, 24-bit Failed with error:", err))
|
||||||
@@ -627,7 +564,6 @@ predictor_overflow_check_24_bit :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
rice_partitions_with_escape_code_zero :: proc(t: ^testing.T) {
|
rice_partitions_with_escape_code_zero :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/subset/64 - rice partitions with escape code zero.flac")
|
data, err := flac.load_from_file("flac-test-files/subset/64 - rice partitions with escape code zero.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("Rice partitions with escape code zero Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("Rice partitions with escape code zero Failed with error:", err))
|
||||||
@@ -636,7 +572,6 @@ rice_partitions_with_escape_code_zero :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
uncommon_32_bit_per_sample :: proc(t: ^testing.T) {
|
uncommon_32_bit_per_sample :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/uncommon/05 - 32bps audio.flac")
|
data, err := flac.load_from_file("flac-test-files/uncommon/05 - 32bps audio.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("Uncommon 32bps audio Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("Uncommon 32bps audio Failed with error:", err))
|
||||||
@@ -645,7 +580,6 @@ uncommon_32_bit_per_sample :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
uncommon_samplerate_768kHz :: proc(t: ^testing.T) {
|
uncommon_samplerate_768kHz :: proc(t: ^testing.T) {
|
||||||
os.stdout = -1
|
|
||||||
data, err := flac.load_from_file("flac-test-files/uncommon/06 - samplerate 768kHz.flac")
|
data, err := flac.load_from_file("flac-test-files/uncommon/06 - samplerate 768kHz.flac")
|
||||||
|
|
||||||
testing.expect(t, err == nil, fmt.tprint("Uncommon samplerate 768kHz Failed with error:", err))
|
testing.expect(t, err == nil, fmt.tprint("Uncommon samplerate 768kHz Failed with error:", err))
|
||||||
|
|||||||
Reference in New Issue
Block a user