Skip to content

feat: Add Base64 Audio Config to Video API Audio Connector implementation - #360

Open
superchilled wants to merge 4 commits into
mainfrom
feat-add-base64-audio-config-video
Open

feat: Add Base64 Audio Config to Video API Audio Connector implementation#360
superchilled wants to merge 4 commits into
mainfrom
feat-add-base64-audio-config-video

Conversation

@superchilled

@superchilled superchilled commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

This PR adds support for the audio_transport params within an Audio Connector Websocket configuration in the Video API implementation. Specifically it:

  • Updates an existing unit test for the method to include the new params
  • Updates the camelcase method of the Keys module to include the audio_transport param
  • Updates the YARD doc comments for the method to include the new params

This PR completes https://jira.vonage.com/browse/DEVX-11291

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for configuring audio_transport within the Video API Audio Connector WebSocket configuration so callers can send an audioTransport object in the request payload.

Changes:

  • Expanded WebSocket#connect unit test coverage to include audio_transport options.
  • Updated Vonage::Keys.camelcase exception handling so audio_transport is converted to audioTransport.
  • Added YARD documentation for :audio_transport options on WebSocket#connect.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
test/vonage/video/web_socket_test.rb Extends request/parameter expectations for audio_transport in connect.
lib/vonage/video/web_socket.rb Documents newly supported :audio_transport configuration options.
lib/vonage/keys.rb Ensures audio_transport is camel-cased to audioTransport in outgoing payloads.
Suppressed comments (1)

test/vonage/video/web_socket_test.rb:73

  • The client-side websocket options passed into connect use snake_case for nested audio_transport keys, but other nested option hashes in this SDK are expected to use the API's camelCase keys (see transcription_properties usage in test/vonage/video/archives_test.rb:55-63). Aligning these keys avoids ambiguity about whether the SDK will deep-camelcase nested hashes.
          transport: 'json',
          encoding: 'base64',
          audio_field: 'audio',
          receive_audio_field: 'audio',
          static_fields: {

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +43 to +47
# @option websocket[:audio_transport] [String] :transport (optional) The transport type for the audio data. Must be one of: "json", "binary".
# @option websocket[:audio_transport] [String] :encoding (optional) The encoding type for the audio data. Required when transport is "json". Must be one of: "base64".
# @option websocket[:audio_transport] [String] :audio_field (optional) The JSON key for the outbound audio data. The default value is "audio".
# @option websocket[:audio_transport] [String] :receive_audio_field (optional) The JSON key for inbound audio data (when bidirectional is enabled). Defaults to the same value as `audio_field`.
# @option websocket[:audio_transport] [Hash] :static_fields (optional) An optional hash of extra key-value pairs included in every outbound JSON audio message.
Comment on lines +46 to +50
transport: 'json',
encoding: 'base64',
audio_field: 'audio',
receive_audio_field: 'audio',
static_fields: {
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