-
Notifications
You must be signed in to change notification settings - Fork 125
Initial SoundQuery() implementation
#2485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| 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
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
#2194
SoundQuery()for a subset of implemented/implementable sound datum variablesrepeat=1sound looping.repeat=2is a TODO that likely requires some work on RT's side