main
cosmonaut 2022-04-20 14:37:59 -07:00
parent 3d795abe94
commit 527622142f
1 changed files with 4 additions and 4 deletions

View File

@ -17,19 +17,19 @@ AudioDevice = new FineAudio.AudioDevice();
Load your sound effects and music:
```cs
StaticSound.Load(AudioSystem, "sword.wav");
StreamingSoundOgg.Load(AudioSystem, "my_song.ogg");
StaticSound.Load(AudioDevice, "sword.wav");
StreamingSoundOgg.Load(AudioDevice, "my_song.ogg");
```
Sound playback is controlled via sound instances.
Streaming sounds are already instances, but static sounds need to have instances created from them.
```cs
var swordSound = StaticSound.LoadWav(AudioSystem, "sword.wav");
var swordSound = StaticSound.LoadWav(AudioDevice, "sword.wav");
var swordSoundInstance = swordSound.GetInstance();
swordSoundInstance.Play();
MySong = StreamingSoundOgg.Load(AudioSystem, "my_song.ogg");
MySong = StreamingSoundOgg.Load(AudioDevice, "my_song.ogg");
MySong.Seek(6f); // seek to 6 seconds
MySong.Play();
```