The Problem Happens at the “Choose File” Step
The original upload control restricted the file picker to common audio MIME types. This usually works in desktop browsers, but some Android systems report M4A as video/mp4、application/mp4, or even an incomplete type. The file may contain valid audio, but the system picker judges only by the type label, so the user cannot select it before the upload even begins.
This issue is a reminder that the MIME shown by the browser is a description provided by the device and file manager, not a final determination of file contents. Treating it as absolute truth creates compatibility breakpoints on mobile devices.
File Extensions, MIME, Containers, and Codecs Are Not the Same Thing
.m4a is a common file extension; MIME is the type label the system passes to the webpage; MP4 is a container; and the container usually holds an actual audio codec such as AAC. The four are related but not interchangeable. Renaming the extension does not convert the codec, and an incorrect MIME label does not necessarily mean the file is damaged.
| Clue | What It Can Tell You | What It Cannot Tell You |
|---|---|---|
| File Extension | How users and apps expect the file to be opened | Does not prove the internal codec is actually valid |
| MIME | How the Device Describes the Selection | Different Android systems may report different values |
| Container | How the Audio Stream and Metadata Are Packaged | The same container can hold different codecs |
| Decode Result | Whether the server can actually decode the audio | Still does not prove the content is suitable for voice analysis |
How CVoice Fixed It
The upload control was changed to a general file picker so Android no longer blocks M4A in advance. After a file is selected, the webpage applies an allowlist check and accepts only WAV, MP3, M4A, WebM, OGG, and AMR. For files that can be identified reliably but lack a standard extension, the page completes the filename;audio/mp4、audio/x-m4a、video/mp4 and application/mp4 all enter the M4A compatibility path.
This does not mean “accept every file.” The picker makes files selectable, the frontend allowlist performs the first safety check, server-side decoding verifies the actual contents, and audio-quality thresholds then determine whether the material is sufficient to generate a report. During the fix, all 79 full-service tests passed, and dedicated checks for Android M4A MIME aliases were added.
A General Diagnostic Order from This Fix
- First confirm that the file is visible in the system picker instead of immediately suspecting the analysis algorithm.
- Log the file extension and MIME reported by the device instead of collecting only “upload failed.”
- Separate “allowed to select” from “allowed to process” so compatibility does not require giving up validation.
- Show different messages for decode errors, insufficient duration, too much silence, and unsupported formats.
- Retest on real mobile devices instead of relying only on desktop browser emulation.