Xenko

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • Manual
  • API
  • Release notes
    Show / Hide Table of Contents

    Stream audio

    Beginner Designer Programmer

    By default, Xenko plays audio directly from memory. This is useful for short sound effects such as gunshots or footsteps.

    Non-streamed audio

    Alternatively, Xenko can buffer audio and stream it in sequences. As soon as the first sequence is buffered, Xenko plays it while buffering the following sequences in parallel. This saves a lot of memory when used for larger audio files such as background music and character dialogue.

    Note

    Streaming audio increases latency unless you preload it with the ReadyToPlay task (see below).

    Streamed audio

    To stream a sound asset:

    1. In the Asset view, select the sound asset.

    2. In the Property grid, select Stream From Disk:

      Sound asset properties

    In the script for the asset, you can configure an audio file to play once the audio engine buffers enough audio samples. To do this, use this task:

    SoundInstance music = musicSound.CreateInstance();
    await music.ReadyToPlay();
    music.Play();
    

    See also

    • Global audio settings
    • Sound asset properties
    • Spatialized audio
    • Non-spatialized audio
    • Improve this Doc

    Back to top

    Copyright © 2016 Silicon Studio
    Generated by DocFX