# Day 2 Feature 2 of 4 - Music

650 views

I was able to use SFML to bring in my recording of my banjo. Seems to suit the goblin nicely. Unfortunately, the video recording is paying the price of the addition of sound (recording framerate is choppy, not quite sure how to fix). Everything works smoothly when it plays though, and here is the result. Gogger loves the Banjo. In order to accomplish this, only a very small amount of code is needed, more work was involved in importing the libraries.

	sf::Music music;
if (!music.openFromFile("../MyGame/Sound/Recording1.ogg"))
return -1; // error

music.play();

Here is a URL if the video doesn't load!

Nice stuff!  So you're a musician too?

I guess this makes me a musician, I can play guitar and banjo. I don't usually think of myself as a musician though. Probably why I ended up paying for sprites, drawing stuff is definitely something I don't have the patience for

1 hour ago, JWColeman said:

I guess this makes me a musician, I can play guitar and banjo. I don't usually think of myself as a musician though. Probably why I ended up paying for sprites, drawing stuff is definitely something I don't have the patience for

Officially you're a musician if you can play an instrument!   It's always a bonus when you have other skill sets to compliment programming!  One less thing to worry about when looking for resources.

🤠 I don't know anything about banjo music, but I'm loving that tune.

Its my own little rendition of Cripple Creek

## Create an account

Register a new account