How to end sound file playing (voice tag)

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
User avatar
The_Gnat
Posts: 2217
Joined: October 10th, 2016, 3:06 am
Contact:

How to end sound file playing (voice tag)

Post by The_Gnat »

I am using the voice= tag in the story of my scenario:

Code: Select all

        [part]
            story= _ "Years pass. Every summer when the mountain passes become clear, the lich sends his soldiers to attack the orcs, removing any human, elven, or dwarvish patrols that get in the way. Every year the undead inflict some damage before being repelled and retreating to the caves."
            {STORYTXT_BACKGROUND end.jpg}
			voice=decent_into_darkness/Descent121.ogg
        [/part]
But if I press the "skip" button while the sound file is playing, it continues to play even while the scenario is running. This is a bad behavior because then the voice over is playing while you are moving your units.

So my question is: how can I fire an event that stop the voice sound file from play?

Thank you! :)

P.S. - I have tried using:

Code: Select all

[music]
	name=the_city_falls.ogg
	append=no
	ms_before=8000
[/music]
And unfortunately it doesn't stop the voice from playing (which makes sense because the 'music' volume control in preferences does not effect the voice's volume so clearly music and voiceovers are not related).

I have also tried (which doesn't work either):

Code: Select all

[music]
	name=horn-signals/horn-1.ogg
	repeat=1
[/music]
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: How to end sound file playing (voice tag)

Post by gfgtdf »

The_Gnat wrote: January 4th, 2019, 12:04 am But if I press the "skip" button while the sound file is playing, it continues to play even while the scenario is running. This is a bad behavior because then the voice over is playing while you are moving your units.
sounds like a bug to be consider filing a bugerport at https://github.com/wesnoth/wesnoth/issues
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
User avatar
The_Gnat
Posts: 2217
Joined: October 10th, 2016, 3:06 am
Contact:

Re: How to end sound file playing (voice tag)

Post by The_Gnat »

Here I have posted the issue on git hub: #3832

Thank you! :D
User avatar
Celtic_Minstrel
Developer
Posts: 2194
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: How to end sound file playing (voice tag)

Post by Celtic_Minstrel »

The voice is a sound source, so you should be able to stop it as one. Try this workaround:

Code: Select all

[remove_sound_source]
	id=wml_message_speaker
[/remove_sound_source
It's still a bug though, so don't go closing the issue or anything.

EDIT: Whoops, I just noticed you were using voice= in [story], not in [message], so that might not work...

EDIT2: Okay, looking over the source suggests that there's no good way of doing it, though maybe if you added 255 empty sound sources it might clear it...
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
User avatar
The_Gnat
Posts: 2217
Joined: October 10th, 2016, 3:06 am
Contact:

Re: How to end sound file playing (voice tag)

Post by The_Gnat »

Celtic_Minstrel wrote: February 19th, 2019, 3:38 am EDIT: Whoops, I just noticed you were using voice= in [story], not in [message], so that might not work...

EDIT2: Okay, looking over the source suggests that there's no good way of doing it, though maybe if you added 255 empty sound sources it might clear it...
That isn't an ideal solution ;) but I appreciate you considering it more.
User avatar
Celtic_Minstrel
Developer
Posts: 2194
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: How to end sound file playing (voice tag)

Post by Celtic_Minstrel »

Yeah, it's not ideal, and I don't know if it would even work. :)
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
Post Reply