Load sound assets without the editor

Hello guys :slight_smile:
I’m following this example https://github.com/xen2/Xenko.CodeOnlySample to get a small working example, but using sound.

My problem, is that reading the documentation, I can’t find the correct way how to load a sound assets directly from a wav / ogg / whatever file directly from the disk.

On the example the texture is loaded from disk, but for the soun base classes i can’t find any similar.

So, how is the correct way for this?

¡thanks!

I don’t know if you’ve found the answer to this yet, but it would be something like:

Sound mySoundFile = Content.Load< Sound >(“The path to the sound asset”);

SoundInstance music = mySoundFile.CreateInstance()

music.Play();

1 Like

Wow, thanks @soulRider for the answer.
Really I forgot this thread a lot of time ago, and my experiments with this project, formerli named Xenko… Wow, inclusive I didn’t noticed the name change of the project!

But well, again thanks for the answer; I Didn’t found anithing about the Content.load function and that it is a generic function that works well to load any kind of asset from disk (or other types of IO streams)

Thanks again for resurrect this.