Appendix B. Encoding music files for IndexedDB storage

 

On both the Mac and Linux platforms, the commands required to perform a base64 conversion of the wav music file is natively supported. On Windows platforms, a third-party tool such as base64.exe can be downloaded to perform the conversion. On a Mac, the conversion can be performed from the terminal using the following format:

base64 -i INPUT_FILE -o OUTPUT_FILE

On a Linux machine, line wrapping can cause unexpected behavior in later file processing. To perform the conversion on a Linux machine without line wrapping, the command becomes:

base64 INPUT_FILE -w 0 > OUTPUT_FILE

Last, from a Windows platform machine, the command to complete the file conversion will depend on the third-party tool used. When using base64.exe on the Windows platform, the command becomes:

Base64.exe -e INPUT_FILE > OUTPUT_FILE