Day 2 Feature 2 of 4 - Music

posted in JWColeman for project Gogger
Published November 30, 2018
Advertisement

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

Gogger Music!.mp4
2 likes 5 comments

Comments

Rutin

Nice stuff! :) So you're a musician too?

November 30, 2018 03:45 AM
JWColeman

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

November 30, 2018 03:47 AM
Rutin
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.

November 30, 2018 04:52 AM
supermikhail

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

November 30, 2018 10:37 AM
JWColeman

Its my own little rendition of Cripple Creek

November 30, 2018 02:13 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement