How to Use WinHex to View Audio File Data and Generate Arrays

Junluan TsuiJunluan Tsui
1 min read

1. Introduction

For preliminary testing, you can use the WinHex software tool to directly convert a small audio file into a C file array. This approach simplifies the downloading and testing process. Here, we provide the method. It is recommended to use MP3 files for testing. For the same duration, MP3 files are significantly smaller than WAV files, making them much more suitable for testing purposes.

2. Usage Instructions

2.1 Using the WinHex Tool

WinHex is a highly convenient tool specifically designed for viewing the contents of files within a device. It is extremely useful.

  • Step 1: Open the file to be converted, as shown in the figure below:

文章内容

  • Step 2: Locate the end of the file, or select an end position based on the actual ROM space available in your MCU.Clearly, in the figure below, the end address is 0x98F.

文章内容

  • Step 3: At the end position, right - click, as shown in the figure below.This will generate a C source code array. Then, create a new text file (e.g., in Notepad) and paste the array into it.

文章内容

#WinHex #AudioFileData #CFileArray #MP3File

0
Subscribe to my newsletter

Read articles from Junluan Tsui directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Junluan Tsui
Junluan Tsui