Skip to content

Recording should honor Playhead Cursor #9403

Description

@chinakov

Bug description

If the User places a cursor anywhere along the project, the recording will still only begin at the end of any given clip on any given track. This shouldn't happen.

Steps to reproduce

  1. Launch AU4
  2. Create a project
  3. Generate some audio clips
  4. Select a track with the clips
  5. Place the playhead before the end of the clip
  6. Press record
  7. Observe result

Expected behavior

The recording starts at the position of the playhead cursor.

Actual behavior

The recording starts at the end of the clip.

Audacity Version

26dbdbb

Operating system

OS independent

Additional context

audacity_G9JegTHnCw.mp4

Activity

  1. added theissue type on Sep 17, 2025
  2. added
    P0
    on Sep 17, 2025
  3. moved this from Design - Todo to Ready for Dev in [AU4] Main Board(archive)on Sep 17, 2025
  4. moved this from Ready for Dev to In Progress in [AU4] Main Board(archive)on Sep 18, 2025
  5. luapmartin commented on Sep 26, 2025

    @luapmartin
    Contributor

    what should happen to the clip(s) already present on the track? after the recording start position

    • will they be pushed after the currently recorded clip

      • from the moment we start recording the entire space is getting inserted there maintaining the insert position distance with next clip (on stop the distance between the recorded clip end and the beginning of the next clip will be the same as the distance from the original playhead position)
      • or only when the recorded clip end would be touching / reaching the start time of next clip the next clips (the rest of the track) are moved to be “attached” after the currently recorded clip until we stop
    • will it be recorded over

      • if partially you can get it back
      • if fully it’s gone forever
      • should the new recording be a new clip that once touching would be merge/glue with the next clip on stop having one clip or a slip between two clips?
    • should the recording stop when touching the next clip

  6. Tantacrul commented on Sep 29, 2025

    @Tantacrul

    @luapmartin

    We discussed this at the standup today. Basically, it's the second approach. Overwrite, rather than insert.

    • We always record from the position of your cursor.
    • A new recording is always a new clip. We do not join with any other clips.
    • We overwrite any clips to the right.
    • If we partially overwrite a clip to the right, you can use the trim feature to get overwritten audio back.
    • If we fully overwrite a clip, it's gone forever.

    Regarding the partial overwriting of clips to the right and using the trim feature to get overwritten audio back: if this turns out to be a technical problem, which I imagine it wont, then we discuss our options. Probably in that case, we just accept that the user can't use the trim feature to get back overwritten audio.

  7. moved this from In Progress to Code Review in [AU4] Main Board(archive)on Oct 2, 2025
  8. grliszas14 commented on Oct 2, 2025

    @grliszas14
    Contributor

    As we debugged with @kryksyh:
    Currently in master branch, we write recorded audio data directly into the original wavetrack. Our audio engine knows nothing about clips, only entire wavetracks are taken into account. When recording buffer is filled, we write audio data from that buffer into a wavetrack via 'Append' function which (as name suggests) appends the data at the end of the track. To change that behavior we would need to dig into audio engine's internals (obviously), we don't know what will be affected then, what can blow up later as this is low-level stuff.

    So the easier solution is to:
    step 1. re-introduce pending tracks (it's a copy of an original track): data is written into a pending track (still at the end) and when recording is finished we simply swap these in place
    step 2. make pending track empty (so there's no limitation about where recording can be started), then at the end of recording we look at the start/end time of a recorded clip, make some room in the original track (trim/remove overlapping clips as discussed) and paste recorded one into the original track

    step 1 is already in code review

  9. 6 remaining items

  10. moved this from Design - Todo to Ready for Dev in [AU4] Main Board(archive)on Oct 3, 2025
  11. moved this from Ready for Dev to In Progress in [AU4] Main Board(archive)on Oct 6, 2025
  12. moved this from In Progress to Code Review in [AU4] Main Board(archive)on Oct 6, 2025
  13. moved this from Code Review to Ready for QA in [AU4] Main Board(archive)on Oct 9, 2025
  14. moved this from Ready for QA to In QA in [AU4] Main Board(archive)on Oct 10, 2025
  15. dozzzzer commented on Oct 10, 2025

    @dozzzzer
    Contributor

    @grliszas14

    1. Have a clip
    2. Put the playhead a few seconds before it
    3. Click the clip's header to select the entire clip
    4. Start recording
    5. Observe: the clip that is being recorded is put behind the existing one.
    2025-10-10_10-18-39.mp4

    This bug is not reproducible in the master because whenever you start recording, it will start immediately after the clip

  16. moved this from In QA to In Progress in [AU4] Main Board(archive)on Oct 10, 2025
  17. self-assigned this
    on Oct 10, 2025
  18. moved this from In Progress to Ready for QA in [AU4] Main Board(archive)on Oct 10, 2025
  19. moved this from Ready for QA to In QA in [AU4] Main Board(archive)on Oct 10, 2025
  20. dozzzzer commented on Oct 10, 2025

    @dozzzzer
    Contributor

    Tested

  21. moved this from In QA to Ready for Merge in [AU4] Main Board(archive)on Oct 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P0bugrecording

Type

Fields

Priority

None yet

Effort

None yet

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions