Using File2ByteSlice for WAV files #1515
-
I found the article regarding some of the tools that were developed along with Ebiten. Very interesting in File2byteslice. I downloaded the source and was able to build an executable. It works great! I am encoding image files (PNG's) to byte slices. I understand how to convert these to an image for using in Ebiten from reading some of the example code. I am curious - if I encode a WAV file to a byte slice will I be able to use it in the game engine? How? Thanks in advance. P.S. - if I should be taking my basic questions somewhere else - please let me know. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Now I recommend to use Go 1.16's new feature: embed instead of file2byteslice. This is the standard way to embed resources and much easier to use. Ebiten will keep using file2byteslice for a while for old Go compilers, but will migrate this into embed in near future.
Wav file format can be decoded with Ebiten's wav package. See examples/wav.
I welcome any questions related to Ebiten here :-) |
Beta Was this translation helpful? Give feedback.
Now I recommend to use Go 1.16's new feature: embed instead of file2byteslice. This is the standard way to embed resources and much easier to use. Ebiten will keep using file2byteslice for a while for old Go compilers, but will migrate this into embed in near future.
Wav file format can be decoded with Ebiten's wav package. See examples/wav.
I welcome any questions related to Ebiten here :-)