Skip to content

Feature: Add setVolume() method for RemoteAudioTrack #6

Description

@Trirrin

Feature Request

Description

Add a setVolume(float volume) method to RemoteAudioTrack class to allow per-participant volume control.

Use Case

In the RMS Chatroom Fabric Mod, users need to adjust the volume of individual voice chat participants (0-200%, similar to Discord). Currently, the SDK's RemoteAudioTrack only exposes setEnabled() and isEnabled() methods, but no volume control.

Proposed API

public class RemoteAudioTrack extends AudioTrack {
    /**
     * Set the playback volume for this remote audio track.
     * @param volume Volume level: 0.0 = mute, 1.0 = normal, 2.0 = 200% boost
     */
    public void setVolume(float volume);
    
    /**
     * Get the current volume level.
     * @return Current volume (0.0 - 2.0)
     */
    public float getVolume();
}

Implementation Notes

This would likely require accessing the underlying WebRTC audio track and applying gain control. The Android LiveKit SDK has this via RemoteAudioTrack.setVolume(double volume).

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions