Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change recording format to M4A #148

Open
ChaoticNeutralCzech opened this issue Dec 2, 2023 · 0 comments · May be fixed by #149
Open

Change recording format to M4A #148

ChaoticNeutralCzech opened this issue Dec 2, 2023 · 0 comments · May be fixed by #149

Comments

@ChaoticNeutralCzech
Copy link

Issue description

This app stores recordings in the MP4 container, which is perfectly fine for audio. However, the extension is .mp4 and the current version of VLC and built-in video for Android, as well as various other apps that open, process or send media files, expect these files to contain a video track, and its absence makes them treat the file as invalid.

Therefore, I propose a very minor change: the file extension should be .m4a (MPEG-4 Audio). The internal structure of .m4a files is identical to normal MP4's, the only difference is that the extension makes applications expect an audio-only file. This has been supported for many, many years.

Proposed solution

The code contains 5 instances of mp4 in total. Most of them (🟢) can just be replaced with m4a. Listed in order of importance:

  1. /app/src/main/java/com/danielkim/soundrecorder/RecordingService.java : 115
    • 🟢 File extension of newly created recording.
  2. /app/src/main/java/com/danielkim/soundrecorder/adapters/FileViewerAdapter.java : 256
    • 🟢 Extension appended to text input from rename dialog
  3. /app/src/main/res/layout/dialog_rename_file.xml : 15
    • 🟢 Rename dialog: text that appears right from textbox
  4. /app/src/main/java/com/danielkim/soundrecorder/adapters/FileViewerAdapter.java : 237
    • ⚠️ MIME type of recorded audio when starting player intent, currently audio/mp4. It could work if replaced with audio/x-m4a or audio/m4a; however, I think keeping it as-is is best for compatibility.
  5. /app/src/main/res/layout/fragment_media_playback.xml : 33
    • 🟢 Placeholder text, replaced before being shown on screen. Replacing with m4a recommended but not neccessary.
ChaoticNeutralCzech added a commit to ChaoticNeutralCzech/SoundRecorder that referenced this issue Dec 3, 2023
@ChaoticNeutralCzech ChaoticNeutralCzech linked a pull request Dec 3, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant