Jump to content
  • Advertisement

Day 2 Feature 2 of 4 - Music

JWColeman

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!

https://puu.sh/C9WZ1/29e00140bf.mp4



5 Comments


Recommended Comments

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 :D

Share this comment


Link to comment
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 :D

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! :D One less thing to worry about when looking for resources.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!