From da4c4c3651ffe636d0377d04a9e10669c24d3eb9 Mon Sep 17 00:00:00 2001 From: IllusionMan1212 Date: Wed, 19 Jun 2024 20:50:08 +0200 Subject: [PATCH] some cleanup --- examples/buffered/main.odin | 193 +++++++++++---------------------- tests/flac_in_memory_test.odin | 66 ----------- 2 files changed, 62 insertions(+), 197 deletions(-) diff --git a/examples/buffered/main.odin b/examples/buffered/main.odin index 283ccd4..a626134 100644 --- a/examples/buffered/main.odin +++ b/examples/buffered/main.odin @@ -44,146 +44,77 @@ main :: proc() { 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) - if alsa_err < 0 { - fmt.eprintln("Playback open error:", alsa.strerror(alsa_err)) - os.exit(1) - } + //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 + //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) + ////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) - } - } + // 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 { - // fmt.eprintln("Playback open error:", alsa.strerror(alsa_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 { + // // fmt.eprintln("Playback open error:", alsa.strerror(alsa_err)) + // // os.exit(1) + // // } + // //} - //converted_samples := make([]u8, len(samples)) - //defer delete(converted_samples) - //for sample, i in samples { - // converted_samples[i] = u8(sample & 0xFF) - //} + // //converted_samples := make([]u8, len(samples)) + // //defer delete(converted_samples) + // //for sample, i in samples { + // // converted_samples[i] = u8(sample & 0xFF) + // //} - converted_samples := make([]i16, len(frame.samples)) - defer delete(converted_samples) - for sample, i in frame.samples { - new_sample := sample & 0xFF - new_sample |= ((sample >> 8) & 0xFF) << 8 - converted_samples[i] = i16(new_sample) - } + // converted_samples := make([]i16, len(frame.samples)) + // defer delete(converted_samples) + // for sample, i in frame.samples { + // new_sample := sample & 0xFF + // 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)) - if frames < 0 { - fmt.eprintln("Error writing to PCM device:", alsa.strerror(auto_cast frames)) - break - } - fmt.printfln("Played %d frames", frames) + // frames := alsa.pcm_writei(handle, raw_data(converted_samples), u64(len(frame.samples)) / u64(frame.channels)) + // if frames < 0 { + // fmt.eprintln("Error writing to PCM device:", alsa.strerror(auto_cast frames)) + // break + // } + // fmt.printfln("Played %d frames", frames) - //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) + // //flac.md5hash(&md5_ctx, flac_data.metadata.bits_per_sample, samples) //} + //end := time.now() - alsa_err = alsa.pcm_drain(handle) - if alsa_err < 0 { - fmt.eprintln("pcm_drain failed with:", alsa.strerror(alsa_err)) - } - alsa.pcm_close(handle) + ////err = flac.md5sum(&md5_ctx, flac_data) + ////if err == .MD5_Mismatch { + //// fmt.println("Decoded audio data is not correct.") + //// os.exit(1) + ////} - elapsed := time.diff(start, end) - fmt.println("Decoding took", elapsed) -} - -old_main :: proc() { - if len(os.args) < 2 { - fmt.eprintln("Please provide a path to a flac file.") - os.exit(1) - } - - handle: ^alsa.pcm_t - - arena: virtual.Arena - arena_err := virtual.arena_init_growing(&arena, mem.Megabyte * 8) - if arena_err != nil { - fmt.eprintln("Failed to alloc memory") - return - } - allocator := virtual.arena_allocator(&arena) - - alsa_err := alsa.pcm_open(&handle, DEVICE, .PLAYBACK, .BLOCK) - if alsa_err < 0 { - fmt.eprintln("Failed to initialize audio device: ", alsa.strerror(alsa_err)) - os.exit(1) - } - - start := time.now() - flac_data, err := flac.load_from_file(os.args[1], allocator = allocator) - if err != nil { - fmt.eprintln(err) - if err == .MD5_Mismatch { - fmt.printfln("Expected: %v, got: %v", flac_data.metadata.expected_md5, flac_data.metadata.calculated_md5) - } - os.exit(1) - } - defer flac.destroy(flac_data, allocator = allocator) - end := time.now() - - fmt.println(flac_data.metadata) - - 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) - } - - 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) + //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) } diff --git a/tests/flac_in_memory_test.odin b/tests/flac_in_memory_test.odin index 314b602..7b5f6af 100644 --- a/tests/flac_in_memory_test.odin +++ b/tests/flac_in_memory_test.odin @@ -7,7 +7,6 @@ import "shared:flac" @(test) test_blocksize_4096 :: proc(t: ^testing.T) { - os.stdout = -1 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)) @@ -16,7 +15,6 @@ test_blocksize_4096 :: proc(t: ^testing.T) { @(test) test_blocksize_4608 :: proc(t: ^testing.T) { - os.stdout = -1 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)) @@ -25,7 +23,6 @@ test_blocksize_4608 :: proc(t: ^testing.T) { @(test) test_blocksize_16 :: proc(t: ^testing.T) { - os.stdout = -1 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)) @@ -34,7 +31,6 @@ test_blocksize_16 :: proc(t: ^testing.T) { @(test) test_blocksize_192 :: proc(t: ^testing.T) { - os.stdout = -1 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)) @@ -43,7 +39,6 @@ test_blocksize_192 :: proc(t: ^testing.T) { @(test) test_blocksize_254 :: proc(t: ^testing.T) { - os.stdout = -1 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)) @@ -52,7 +47,6 @@ test_blocksize_254 :: proc(t: ^testing.T) { @(test) test_blocksize_512 :: proc(t: ^testing.T) { - os.stdout = -1 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)) @@ -61,7 +55,6 @@ test_blocksize_512 :: proc(t: ^testing.T) { @(test) test_blocksize_725 :: proc(t: ^testing.T) { - os.stdout = -1 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)) @@ -70,7 +63,6 @@ test_blocksize_725 :: proc(t: ^testing.T) { @(test) test_blocksize_1000 :: proc(t: ^testing.T) { - os.stdout = -1 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)) @@ -79,7 +71,6 @@ test_blocksize_1000 :: proc(t: ^testing.T) { @(test) test_blocksize_1937 :: proc(t: ^testing.T) { - os.stdout = -1 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)) @@ -88,7 +79,6 @@ test_blocksize_1937 :: proc(t: ^testing.T) { @(test) test_blocksize_2304 :: proc(t: ^testing.T) { - os.stdout = -1 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)) @@ -97,7 +87,6 @@ test_blocksize_2304 :: proc(t: ^testing.T) { @(test) 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") 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_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") 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_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") 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) wasted_bits :: proc(t: ^testing.T) { - os.stdout = -1 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)) @@ -133,7 +119,6 @@ wasted_bits :: proc(t: ^testing.T) { @(test) 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") 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) 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") testing.expect( @@ -155,7 +139,6 @@ partition_order_8_containing_escaped_partitions :: proc(t: ^testing.T) { @(test) 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") 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) precision_search :: proc(t: ^testing.T) { - os.stdout = -1 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)) @@ -173,7 +155,6 @@ precision_search :: proc(t: ^testing.T) { @(test) samplerate_35467Hz :: proc(t: ^testing.T) { - os.stdout = -1 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)) @@ -182,7 +163,6 @@ samplerate_35467Hz :: proc(t: ^testing.T) { @(test) samplerate_39kHz :: proc(t: ^testing.T) { - os.stdout = -1 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)) @@ -191,7 +171,6 @@ samplerate_39kHz :: proc(t: ^testing.T) { @(test) samplerate_22050Hz :: proc(t: ^testing.T) { - os.stdout = -1 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)) @@ -200,7 +179,6 @@ samplerate_22050Hz :: proc(t: ^testing.T) { @(test) _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") 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) _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") 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) variable_blocksize_file_created_with_flake_revision_264 :: proc(t: ^testing.T) { - os.stdout = -1 data, err := flac.load_from_file( "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) 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( "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) variable_blocksize_file_created_with_CUETools_Flake_2_1_6 :: proc(t: ^testing.T) { - os.stdout = -1 data, err := flac.load_from_file( "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) old_format_variable_blocksize_file_created_with_Flake_0_11 :: proc(t: ^testing.T) { - os.stdout = -1 data, err := flac.load_from_file( "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) 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") 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) 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") 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) 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") 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) high_resolution_audio_using_only_32nd_order_predictors :: proc(t: ^testing.T) { - os.stdout = -1 data, err := flac.load_from_file( "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) high_resolution_audio_partition_order_8_containing_escaped_partitions :: proc(t: ^testing.T) { - os.stdout = -1 data, err := flac.load_from_file( "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) samplerate_192kHz :: proc(t: ^testing.T) { - os.stdout = -1 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)) @@ -347,7 +314,6 @@ samplerate_192kHz :: proc(t: ^testing.T) { @(test) 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") testing.expect( @@ -360,7 +326,6 @@ samplerate_192kHz_using_only_32nd_order_predictors :: proc(t: ^testing.T) { @(test) samplerate_134560Hz :: proc(t: ^testing.T) { - os.stdout = -1 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)) @@ -369,7 +334,6 @@ samplerate_134560Hz :: proc(t: ^testing.T) { @(test) samplerate_384kHz :: proc(t: ^testing.T) { - os.stdout = -1 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)) @@ -378,7 +342,6 @@ samplerate_384kHz :: proc(t: ^testing.T) { @(test) _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") 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) _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") testing.expect(t, err == nil, fmt.tprint("3 channels Failed with error:", err)) @@ -396,7 +358,6 @@ _3_channels :: proc(t: ^testing.T) { @(test) _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") testing.expect(t, err == nil, fmt.tprint("4 channels Failed with error:", err)) @@ -405,7 +366,6 @@ _4_channels :: proc(t: ^testing.T) { @(test) _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") testing.expect(t, err == nil, fmt.tprint("5 channels Failed with error:", err)) @@ -414,7 +374,6 @@ _5_channels :: proc(t: ^testing.T) { @(test) _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") testing.expect(t, err == nil, fmt.tprint("6 channels Failed with error:", err)) @@ -423,7 +382,6 @@ _6_channels :: proc(t: ^testing.T) { @(test) _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") testing.expect(t, err == nil, fmt.tprint("7 channels Failed with error:", err)) @@ -432,7 +390,6 @@ _7_channels :: proc(t: ^testing.T) { @(test) _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") testing.expect(t, err == nil, fmt.tprint("8 channels Failed with error:", err)) @@ -441,7 +398,6 @@ _8_channels :: proc(t: ^testing.T) { @(test) _8_channel_surround_192kHz_24_bit_using_only_32nd_order_predictors :: proc(t: ^testing.T) { - os.stdout = -1 data, err := flac.load_from_file( "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) 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") 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) 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") 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) only_streaminfo :: proc(t: ^testing.T) { - os.stdout = -1 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)) @@ -483,7 +436,6 @@ only_streaminfo :: proc(t: ^testing.T) { @(test) 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") 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) 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") 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) 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") 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) 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") 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) 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") 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) 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") 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) _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") 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) 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") 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) jpg_picture :: proc(t: ^testing.T) { - os.stdout = -1 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)) @@ -564,7 +508,6 @@ jpg_picture :: proc(t: ^testing.T) { @(test) png_picture :: proc(t: ^testing.T) { - os.stdout = -1 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)) @@ -573,7 +516,6 @@ png_picture :: proc(t: ^testing.T) { @(test) gif_picture :: proc(t: ^testing.T) { - os.stdout = -1 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)) @@ -582,7 +524,6 @@ gif_picture :: proc(t: ^testing.T) { @(test) avif_picture :: proc(t: ^testing.T) { - os.stdout = -1 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)) @@ -591,7 +532,6 @@ avif_picture :: proc(t: ^testing.T) { @(test) mono_audio :: proc(t: ^testing.T) { - os.stdout = -1 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)) @@ -600,7 +540,6 @@ mono_audio :: proc(t: ^testing.T) { @(test) 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") 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) 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") 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) 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") 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) 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") 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) 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") 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) uncommon_samplerate_768kHz :: proc(t: ^testing.T) { - os.stdout = -1 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))