Skip to content

Conversation

@ike709
Copy link
Collaborator

@ike709 ike709 commented Jan 6, 2026

#2194

  • Implements SoundQuery() for a subset of implemented/implementable sound datum variables
  • Implements repeat=1 sound looping. repeat=2 is a TODO that likely requires some work on RT's side

@ike709 ike709 marked this pull request as draft January 6, 2026 17:43
@boring-cyborg boring-cyborg bot added Client Involves the OpenDream client Compiler Involves the OpenDream compiler Runtime Involves the OpenDream server/runtime labels Jan 6, 2026
@github-actions github-actions bot added the size/L label Jan 6, 2026
@ike709 ike709 marked this pull request as ready for review January 7, 2026 04:48
public SoundData SoundData {
get {
_soundData.Offset = Source.Component.PlaybackPosition;
_soundData.Length = (float)audioSystem.GetAudioLength(Source.Component.FileName).TotalSeconds;

Check warning

Code scanning / InspectCode

Use of obsolete symbol Warning

CS0618: Operator 'implicit Robust.Shared.Audio.ResolvedSoundSpecifier.operator ResolvedSoundSpecifier(string)' is obsolete: 'String literals for sounds are deprecated, use a SoundSpecifier or ResolvedSoundSpecifier as appropriate instead'
Copy link
Collaborator Author

@ike709 ike709 Jan 7, 2026

Choose a reason for hiding this comment

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

Electing to ignore this as converting a bunch of audio code to use sound specifiers is out of scope and GetAudioLength(SoundSpecifier) just calls this GetAudioLength(string) overload currently anyways.


var db = 20 * MathF.Log10(volume); // convert from DM volume (0-100) to OpenAL volume (db)
var source = _audioSystem.PlayGlobal(stream, null, AudioParams.Default.WithVolume(db).WithPlayOffset(offset)); // TODO: Positional audio.
var db = 20 * MathF.Log10(soundData.Volume / 100.0f); // convert from DM volume (0-100) to OpenAL volume (db)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The / 100.0f has been moved from the only PlaySound() method call to in the method itself. Not sure if that's the right move or not but it simplifies things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Client Involves the OpenDream client Compiler Involves the OpenDream compiler Runtime Involves the OpenDream server/runtime size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants