nativeaudio

audio playback for Go
Log | Files | Refs | README | LICENSE

commit 8b84f1e37cbdfefceb2f808f235ee1b1932f7e13
parent 3126dcc8bb9d5422d1bb90975ac345d331016ce2
Author: Jack Mordaunt <jackmordaunt.dev@gmail.com>
Date:   Mon,  6 May 2024 13:14:57 +0800

test: benchmark decode against decode

No point comparing a load to a decode.

Diffstat:
Minternal/test/audio_test.go | 14++------------
1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/internal/test/audio_test.go b/internal/test/audio_test.go @@ -192,16 +192,6 @@ func abs(n int) int { } func BenchmarkDecode(b *testing.B) { - b.Run("native-load", func(b *testing.B) { - for ii := 0; ii < b.N; ii++ { - by, f, err := nativeaudio.Load("compressed.m4a") - if err != nil { - b.Fatalf("unexpected error during decode: %v", err) - } - _ = by - _ = f - } - }) b.Run("native-decode", func(b *testing.B) { for ii := 0; ii < b.N; ii++ { by, f, err := nativeaudio.Decode(compressed) @@ -212,9 +202,9 @@ func BenchmarkDecode(b *testing.B) { _ = f } }) - b.Run("ffmpeg-load", func(b *testing.B) { + b.Run("ffmpeg-decode", func(b *testing.B) { for ii := 0; ii < b.N; ii++ { - by, f, err := nativeaudio.FFmpegLoad("compressed.m4a") + by, f, err := nativeaudio.FFmpegDecode(compressed) if err != nil { b.Fatalf("unexpected error during decode: %v", err) }