SFML community forums

Help => Audio => Topic started by: Brokenhope on April 20, 2017, 07:45:50 pm

Title: Sound from Resource
Post by: Brokenhope on April 20, 2017, 07:45:50 pm
I was looking into using SFML to play sounds in a game I have created. It is Win32, using GDI+. I like to keep everything nice and tidy in the resource .rc file.

What I am wondering is, is there a way I can load a .mid file from the resource into the sound buffer. I was looking at example code and openFromMemory() looked like a potential possibility.

any thoughts?
Title: Re: Sound from Resource
Post by: Mario on April 21, 2017, 08:54:42 am
SFML doesn't support loading resources directly nor loading or sampling MIDI files. However, since your application seems to be Windows only anyway, you could just use Windows' Media Control Interface (https://msdn.microsoft.com/en-us/library/windows/desktop/dd742874(v=vs.85).aspx) for playback.