From 6e490998d2a0e8f395e0cc63a84f95a5f5da4cb9 Mon Sep 17 00:00:00 2001 From: WeebDataHoarder <57538841+WeebDataHoarder@users.noreply.github.com> Date: Sun, 15 May 2022 19:22:02 +0200 Subject: [PATCH] Expose flac Version/Vendor string --- libflac.go | 8 ++++++++ libflac_test.go | 10 ++++++++++ 2 files changed, 18 insertions(+) diff --git a/libflac.go b/libflac.go index 915d13d..8b24e9a 100644 --- a/libflac.go +++ b/libflac.go @@ -694,3 +694,11 @@ func (e *Encoder) Close() { } runtime.SetFinalizer(e, nil) } + +func Version() string { + return C.GoString(C.FLAC__VERSION_STRING) +} + +func Vendor() string { + return C.GoString(C.FLAC__VENDOR_STRING) +} diff --git a/libflac_test.go b/libflac_test.go index 0f28148..1da1e32 100644 --- a/libflac_test.go +++ b/libflac_test.go @@ -427,3 +427,13 @@ func TestRoundTripReaderWriterSeeker(t *testing.T) { os.Remove(outputFile) } + +func TestVersion(t *testing.T) { + + t.Logf("version: %s", Version()) +} + +func TestVendor(t *testing.T) { + + t.Logf("vendor: %s", Vendor()) +}