Import audio files and folders, and accept shared audio #15

Merged
florian merged 1 commit from florian/import-recordings into main 2026-11-03 22:45:45 +01:00 AGit
Owner

Why

Android doesn't let a regular app record phone calls. Importing lets another app make the recording, such as the phone's own call recorder, while PeggyPad handles the transcript, summary and notes. This also covers the roadmap item for restoring recordings from a folder.

What changes

  • Audio files: pick them with the new import button, or share them to PeggyPad from another app. After you confirm, a copy goes to the recordings folder.
  • Folders: import in place, including the transcripts and summaries PeggyPad wrote, with or without their audio. Other Markdown files are left alone, because a linked transcript can later be overwritten. Subfolders are skipped.
  • Duplicates: audio already in the app is recognised by its SHA-256 and skipped, so a folder can be imported again.
  • Upload type: recordings are sent with their real audio type instead of always audio/ogg.
  • Delete dialog: it now names the file and folder, as that may be another app's folder.
  • README: documents the import, and adds format and size warnings and optional transcoding to the roadmap.

Security

The share target is exported, so other apps can call it directly:

  • Only content:// URIs from other apps are accepted. This stops a file:// URI or one of our own authorities from getting private data copied to a shared folder.
  • Nothing is imported until the user confirms.
  • File names from other apps are sanitised.
  • Files must be readable as audio.

Testing

  • 44 unit tests pass, 11 of them new (ImportFilesTest).
  • Checked by hand on an API 36 emulator:
    • importing m4a and mp3 from the picker, and playing back the m4a
    • sharing through the Android share sheet, using a recording shared from PeggyPad itself, so it was detected as a duplicate
    • rejecting fake audio, a file:// URI and our own authority
    • importing a mixed folder, importing it again, and reinstalling then restoring
    • access to the folder after restarting the app
    • transcribing against a local stub server, which received audio/mp4 for an m4a
    • deleting a recording, and the new line in the delete dialog
  • Not tested: a real call recording on a physical phone, and a real transcription provider.

Known limitations

  • Notes and participants live in the app database, so they don't come back after a reinstall.
  • The link to an existing meeting note doesn't come back either, so the next export writes a new note next to it.
  • Files without a date in their name or metadata get the file's modified time, which is the copy time for a file PeggyPad copied earlier.
  • Imported audio isn't re-encoded, so it can reach a provider's size limit sooner.
  • Sharing an m4a from a picked folder can still offer it as audio/mpeg, because Share.kt uses the type Android reports. Transcription isn't affected.

🤖 Generated with Claude Code

## Why Android doesn't let a regular app record phone calls. Importing lets another app make the recording, such as the phone's own call recorder, while PeggyPad handles the transcript, summary and notes. This also covers the roadmap item for restoring recordings from a folder. ## What changes - **Audio files:** pick them with the new import button, or share them to PeggyPad from another app. After you confirm, a copy goes to the recordings folder. - **Folders:** import in place, including the transcripts and summaries PeggyPad wrote, with or without their audio. Other Markdown files are left alone, because a linked transcript can later be overwritten. Subfolders are skipped. - **Duplicates:** audio already in the app is recognised by its SHA-256 and skipped, so a folder can be imported again. - **Upload type:** recordings are sent with their real audio type instead of always `audio/ogg`. - **Delete dialog:** it now names the file and folder, as that may be another app's folder. - **README:** documents the import, and adds format and size warnings and optional transcoding to the roadmap. ## Security The share target is exported, so other apps can call it directly: - Only `content://` URIs from other apps are accepted. This stops a `file://` URI or one of our own authorities from getting private data copied to a shared folder. - Nothing is imported until the user confirms. - File names from other apps are sanitised. - Files must be readable as audio. ## Testing - 44 unit tests pass, 11 of them new (`ImportFilesTest`). - Checked by hand on an API 36 emulator: - importing m4a and mp3 from the picker, and playing back the m4a - sharing through the Android share sheet, using a recording shared from PeggyPad itself, so it was detected as a duplicate - rejecting fake audio, a `file://` URI and our own authority - importing a mixed folder, importing it again, and reinstalling then restoring - access to the folder after restarting the app - transcribing against a local stub server, which received `audio/mp4` for an m4a - deleting a recording, and the new line in the delete dialog - **Not tested:** a real call recording on a physical phone, and a real transcription provider. ## Known limitations - Notes and participants live in the app database, so they don't come back after a reinstall. - The link to an existing meeting note doesn't come back either, so the next export writes a new note next to it. - Files without a date in their name or metadata get the file's modified time, which is the copy time for a file PeggyPad copied earlier. - Imported audio isn't re-encoded, so it can reach a provider's size limit sooner. - Sharing an m4a from a picked folder can still offer it as `audio/mpeg`, because `Share.kt` uses the type Android reports. Transcription isn't affected. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Add an import for audio from elsewhere, such as a phone's call recorder,
which Android doesn't let a regular app record itself.

- Audio files can be picked or shared to PeggyPad, and are copied to the
  recordings folder after the user confirms.
- A folder can be imported in place, including the transcripts and
  summaries PeggyPad wrote, e.g. after reinstalling.
- Audio already in the app is recognised by its SHA-256 and skipped.
- Shares only accept content URIs from other apps, so nothing can trick
  the app into copying its private data to a shared folder.
- Recordings are uploaded with their real audio type instead of always
  audio/ogg.
- The delete dialog names the file and folder, as that may now be
  another app's folder.

Add warnings about format and size, and optional transcoding, to the
roadmap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
florian/peggypad!15
No description provided.