Commit Graph

776 Commits

Author SHA1 Message Date
Hajime Hoshi
4bccf9d009 all: use math/rand/v2 2024-09-12 01:17:26 +09:00
Hajime Hoshi
a4bfa6cb15 all: use Go 1.21's min/max builtin functions 2024-09-12 01:01:05 +09:00
Hajime Hoshi
a36f6210c0 all: use Go 1.20 APIs
Closes #2746
2024-09-12 00:22:45 +09:00
Hajime Hoshi
26feb26237 audio: add more info for errors
Updates ebitengine/oto#93
2024-09-10 12:29:06 +09:00
Hajime Hoshi
8f32cc19c5 audio: update comments 2024-08-18 11:13:35 +09:00
Hajime Hoshi
719838b7ab .github/workflows: update wasmbrowsertest to fix timeout issue
The issue agnivade/wasmbrowsertest#60 was fixed.

Updates #1313
2024-08-02 23:03:01 +09:00
Hajime Hoshi
b78475ed78 audio/internal/convert: try to make the test stable 2024-07-21 23:31:38 +09:00
Hajime Hoshi
cdef7df61d audio: update comments
Updates #2160
2024-07-21 21:45:55 +09:00
Hajime Hoshi
a032a5d71c audio: update comments
Updates #2160
2024-07-21 21:42:19 +09:00
Hajime Hoshi
f0ef1ecad0 all: add float32 version of audio APIs
This change adds these APIs

 * (*audio.Context).NewPlayerF32
 * (*audio.Context).NewPlayerF32FromBytes
 * audio.NewInfiniteLoopF32
 * audio.NewInfiniteLoopWithIntroF32
 * audio.ResampleF32
 * mp3.DecodeF32
 * vorbis.DecodeF32
 * wav.DecodeF32

Closes #2160
2024-07-21 19:12:18 +09:00
Hajime Hoshi
1d7c350967 audio/mp3: refactoring 2024-07-21 17:00:46 +09:00
Hajime Hoshi
a6a6709163 audio: use float32 instead of float64 for blending
Updates #2160
2024-07-21 16:32:12 +09:00
Hajime Hoshi
ef8afc6cf2 audio/vorbis: refactoring 2024-07-21 15:25:32 +09:00
Hajime Hoshi
1d260eac51 audio/internal/convert: bug fix: StereoI16 didn't work in some cases
There are no such actual use cases, so this is not a critical bug.
2024-07-21 11:37:07 +09:00
Hajime Hoshi
f36ea4125d audio/internal/convert: split some tests 2024-07-21 11:37:07 +09:00
Hajime Hoshi
f6c9c88f78 audio/internal/convert: better tests for Seek 2024-07-21 11:25:47 +09:00
Hajime Hoshi
e43ab06f35 audio/internal/convert: bug fix: the test input must be even number of float32s 2024-07-21 11:10:20 +09:00
Hajime Hoshi
a5213de991 audio/internal/convert: use math/rand instead of crypto/rand 2024-07-21 10:54:33 +09:00
Hajime Hoshi
f63c1c8fc5 audio/internal/convert: add StereoF32
Updates #2160
2024-07-21 10:52:10 +09:00
Hajime Hoshi
4689d656aa audio/vorbis: refactoring 2024-07-21 10:10:48 +09:00
Hajime Hoshi
52820e2b43 audio: reland: bug fix: crash with uncomparable source
Closes #3039
2024-07-15 14:18:18 +09:00
Hajime Hoshi
420a6c16de Revert "audio: bug fix: crash with uncomparable source"
This reverts commit e980d59191.

Reason: Compile error with Go 1.19
2024-07-15 13:52:50 +09:00
Hajime Hoshi
e980d59191 audio: bug fix: crash with uncomparable source
Closes #3039
2024-07-15 13:46:23 +09:00
Hajime Hoshi
af29b7194d audio/wav: typo 2024-07-14 23:45:25 +09:00
Hajime Hoshi
531dc7efd9 audio/internal/convert: return an error when not seekable 2024-07-14 23:39:52 +09:00
Hajime Hoshi
b0753008ab audio/wav: refactoring 2024-07-14 22:56:26 +09:00
Hajime Hoshi
09cac12390 audio: bug fix: reduce test flakiness 2024-07-14 21:18:08 +09:00
Hajime Hoshi
1d75c9e967 audio/internal/convert: Seek with incomplete bytes should work
Usually users use audio.Player objects and doesn't use Resampling
object directly. Resampling object itself is exposed by
audio.Resample, but this is usually used with audio.Player objects.
Thus, this issue is not so serious in the real world.
2024-07-14 18:37:15 +09:00
Hajime Hoshi
fc70392093 audio/internal/convert: typo 2024-07-14 17:51:44 +09:00
Hajime Hoshi
b552266afe audio/internal/convert: enable to resample a float32 stream
Updates #2160
2024-07-14 17:51:24 +09:00
Hajime Hoshi
bf90217e68 audio: skip TestNonSeekableSource on browsers 2024-07-14 01:22:15 +09:00
Hajime Hoshi
0963b8a7e3 audio: bug fix: players were not finished at TestNonSeekableSource 2024-07-14 00:48:55 +09:00
Hajime Hoshi
91cdaa9f11 audio/internal/convert: bug fix: Read never returned io.EOF when seeked 2024-07-14 00:04:32 +09:00
Hajime Hoshi
c03ece2671 audio: GC a player
This is not necessary but it is always better to clean up unused
players.
2024-07-14 00:03:59 +09:00
Hajime Hoshi
03ca5c3b26 audio/internal/convert: bug fix: skip tests on browsers correctly 2024-07-14 00:03:44 +09:00
Hajime Hoshi
bf3ded2a55 audio: bug fix: test out of memory on browsers 2024-07-13 23:13:30 +09:00
Hajime Hoshi
6f74e03cb3 audio/internal/convert: better tests 2024-07-13 22:42:26 +09:00
Hajime Hoshi
96a07c1bf2 audio/internal/convert: bug fix: skip some tests on browsers 2024-07-13 22:39:37 +09:00
Hajime Hoshi
43f505b3a0 audio: use float32 format under the hood
Updates #2160
2024-07-13 21:46:39 +09:00
Hajime Hoshi
f8e3bef368 audio/internal/convert: refactoring: move utilities to audio/vorbis 2024-07-07 17:03:11 +09:00
Hajime Hoshi
844a4de872 audio: remove const bytesPerSampleInt16
This is a preparation for float32 players.

Updates #2160
2024-07-06 23:57:05 +09:00
Hajime Hoshi
9ef27a2c75 audio: make applicationState() thread-safe
Closes #3021
2024-07-06 17:41:42 +09:00
Hajime Hoshi
5942192b66 audio/vorbis: refactoring 2024-05-21 02:42:43 +09:00
Hajime Hoshi
a612e74031 audio/wav: add (*Stream).SampleRate
Closes #2996
2024-05-18 20:19:27 +09:00
Hajime Hoshi
ac83181403 audio/mp3: add (*Stream).SampleRate
Updates #2996
2024-05-18 20:13:36 +09:00
Hajime Hoshi
d2c58dac8c audio/vorbis: add (*Stream).SampleRate
Updates #2996
2024-05-18 20:09:37 +09:00
Hajime Hoshi
322ad99568 audio/mp3, audio/vorbis, audio/wav: add comments about cache 2024-05-04 17:30:18 +09:00
Hajime Hoshi
6bbfec1869 audio: refactoring: initialize the context at an update hook
Closes #2715
2024-03-16 22:42:04 +09:00
Hajime Hoshi
9cd525a04e audio: bug fix: position adjustment should not start before ready
Updates #2901
2024-03-16 22:03:36 +09:00
Hajime Hoshi
9cc017412f audio: refactoring 2024-03-16 21:44:39 +09:00