Added audio playback to the AssetBrowser

This commit is contained in:
penev92
2022-01-05 00:12:11 +02:00
committed by Matthias Mailänder
parent 7a9e0863d6
commit 8b944e9c82
7 changed files with 36 additions and 1 deletions

View File

@@ -165,6 +165,14 @@ namespace OpenRA
return Play(type, player, names.Random(world.LocalRandom), false, pos, volumeModifier);
}
public ISound Play(ISoundFormat soundFormat) => Play(soundFormat, MusicVolume);
public ISound Play(ISoundFormat soundFormat, float volume)
{
return soundEngine.Play2DStream(soundFormat.GetPCMInputStream(), soundFormat.Channels, soundFormat.SampleBits, soundFormat.SampleRate,
false, true, WPos.Zero, volume);
}
public void PlayVideo(byte[] raw, int channels, int sampleBits, int sampleRate)
{
StopVideo();