Skip to content

feat: RMS, silence trim, and last user text - #4

Open
topninja wants to merge 1 commit into
mainfrom
feat/rms-trim-last-user
Open

feat: RMS, silence trim, and last user text#4
topninja wants to merge 1 commit into
mainfrom
feat/rms-trim-last-user

Conversation

@topninja

Copy link
Copy Markdown
Collaborator

Summary

  • audio.RMS reports the root-mean-square amplitude of a 16-bit PCM chunk.
  • audio.TrimSilence and processor.NewAudioTrim drop leading and trailing silence without dropping the frame.
  • frames.LLMContext.LastUserText returns the most recent spoken user turn, skipping tool-result placeholders.

Independent of the other open session-helper PRs: this branch is from current main.

Test plan

  • go test ./audio ./frames ./processor
  • Confirm a silent-padded utterance is trimmed and a fully silent chunk stays an empty payload
  • Confirm LastUserText ignores a tool-result message written as the user role

Give sessions a way to measure PCM energy, strip leading and trailing
silence, and read the most recent spoken user turn.

Co-authored-by: Cursor <cursoragent@cursor.com>
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 this pull request may close these issues.

2 participants