Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
Audio
»
How to repeat music?
Print
Pages: [
1
]
Author
Topic: How to repeat music? (Read 4790 times)
0 Members and 1 Guest are viewing this topic.
StrengthSauce
Newbie
Posts: 3
How to repeat music?
«
on:
April 27, 2015, 11:48:18 pm »
Can I repeat the background music of my game forever until I want it to stop?
All I have right now is:
// Load music and play.
sf
::
Music
mTheme
;
if
(
!
mTheme.
openFromFile
(
"Theme.wav"
)
)
return
-
1
;
mTheme.
play
(
)
;
Logged
dabbertorres
Hero Member
Posts: 505
Re: How to repeat music?
«
Reply #1 on:
April 27, 2015, 11:57:34 pm »
if
(
mTheme.
getStatus
(
)
!
=
sf
::
Music
::
Status
::
Playing
)
mTheme.
play
(
)
;
documentation
.
Logged
Github
AlexAUT
Sr. Member
Posts: 396
Re: How to repeat music?
«
Reply #2 on:
April 28, 2015, 12:08:06 am »
Or even simpler:
mTheme.
setLoop
(
true
)
;
Link to setLoop
AlexAUT
Logged
Android (Play Store):
https://play.google.com/store/apps/details?id=com.alexaut.kroniax.android
dabbertorres
Hero Member
Posts: 505
Re: How to repeat music?
«
Reply #3 on:
April 28, 2015, 07:21:41 am »
Well that's a bit ironic on my part. Guess I should get my eyes checked.
Logged
Github
Print
Pages: [
1
]
SFML community forums
»
Help
»
Audio
»
How to repeat music?
anything