Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: joelphilippage on Sun 14/12/2008 01:57:39

Title: Background Music with Video
Post by: joelphilippage on Sun 14/12/2008 01:57:39
I hope this isn't my fault but I am trying to play a video while the background music is still playing.
function room_Load()
{
  PlayMusic(7);
  PlayVideo("Movies/Intro.Avi", 1, 10);
  cEgo.Transparency = 100;
}

The music needs to line up with the video and doesn't start until I select the window. The game won't start up selected. Is there a way to fix this?
Title: Re: Background Music with Video
Post by: Dualnames on Sun 14/12/2008 20:53:48
Quote from: joelphilippage on Sun 14/12/2008 01:57:39
I hope this isn't my fault but I am trying to play a video while the background music is still playing.
function room_Load()
{
  PlayMusic(7);
  PlayVideo("Movies/Intro.Avi", 1, 10);
  cEgo.Transparency = 100;
}

The music needs to line up with the video and doesn't start until I select the window. The game won't start up selected. Is there a way to fix this?

I've used once and more a certain thing in my games..and it did work..does the movie work properly if played by itself?
Title: Re: Background Music with Video
Post by: joelphilippage on Sun 14/12/2008 22:06:14
The movie works fine either way. It's just the sound that won't work while the games not selected.
Title: Re: Background Music with Video
Post by: Dualnames on Sun 14/12/2008 22:21:30
ow, that has to do with setmultitaskingmode function.
Title: Re: Background Music with Video
Post by: joelphilippage on Sun 14/12/2008 22:29:28
Your close. Now it works in windowed mode but not full screen.
Title: Re: Background Music with Video
Post by: Dualnames on Sun 14/12/2008 22:35:08
 PlayVideo("Movies/Intro.Avi", 1, 11);

Try changing to this..that might work full screen..if it does, you can check if the game is full screen or window and play the video accordingly.. 
Title: Re: Background Music with Video
Post by: joelphilippage on Sun 14/12/2008 22:57:09
That didn't work. I guess I'll just run it windowed unless someone knows a way to fix it.
Title: Re: Background Music with Video
Post by: Trent R on Mon 15/12/2008 00:11:19
It has nothing to do with the slash in the file name? That seems to me like it could screw stuff up....


~Trent
Title: Re: Background Music with Video
Post by: subspark on Mon 15/12/2008 05:13:51
So's this a bug or...

Sparx.
Title: Re: Background Music with Video
Post by: Dualnames on Mon 15/12/2008 20:55:55
Quote from: subspark on Mon 15/12/2008 05:13:51
So's this a bug or...

Sparx.

Joel? Can you remove that line with cego transparency..or add a wait before it?
Title: Re: Background Music with Video
Post by: joelphilippage on Tue 16/12/2008 22:20:51
Trent R: The / in the file name is to show that it's in the movies folder.
Dualnames: I tried it and it still didn't work.
Title: Re: Background Music with Video
Post by: Dualnames on Tue 16/12/2008 23:29:55
Well, I'm out of ideas. I'd go and post about it at AGS Engine Topic. Last guess: are you using media manager plugin(whatever it's called)?
Title: Re: Background Music with Video
Post by: joelphilippage on Tue 16/12/2008 23:31:27
Sorry I don't.
Title: Re: Background Music with Video
Post by: Dualnames on Tue 16/12/2008 23:41:54
Quote from: joelphilippage on Tue 16/12/2008 23:31:27
Sorry I don't.

Well, it's definetely weird..well CJ might give you an anwer..
Title: Re: Background Music with Video
Post by: Trent R on Wed 17/12/2008 00:59:53
Quote from: joelphilippage on Tue 16/12/2008 22:20:51
Trent R: The / in the file name is to show that it's in the movies folder.
Well yeah, but have you tried it in the root folder? Does it work then?

~Trent
Title: Re: Background Music with Video
Post by: joelphilippage on Wed 17/12/2008 01:09:21
I tried that too. It's still not working.
Title: Re: Background Music with Video
Post by: Gilbert on Wed 17/12/2008 01:22:42
It would be odd if it's related to in what folder the file is placed, so there's little chance it's the cause.

I'm not familiar with movie playing, but a thing you may check is with what codec the AVI file was encoded in. It may be possible that the driver responsible for playing that kind of movies steals the focus or prevents other sounds to play. You may try AVI files encoded with other codecs (for testing purpose just random movie files may do) and see if it yields a different result.
Title: Re: Background Music with Video
Post by: joelphilippage on Wed 17/12/2008 01:24:57
It's encoded with divix and I'm using a divix codec.
Title: Re: Background Music with Video
Post by: Dualnames on Wed 17/12/2008 01:26:33
Quote from: joelphilippage on Wed 17/12/2008 01:24:57
It's encoded with divix and I'm using a divix codec.

Try placing a normally encoded AVI instead of that of yours to see if it works,.
Title: Re: Background Music with Video
Post by: Pumaman on Sun 21/12/2008 16:00:03
What exactly is the problem? Is the sound not playing at all?
Title: Re: Background Music with Video
Post by: joelphilippage on Sun 21/12/2008 23:25:05
I'll try to describe this more clearly. I will start the game in windowed mode. The window for the game is not selected the video and the music will play at the same time because I set multi-tasking mode on. The music will not play during the video in windowed mode when it is not in multi-tasking mode. When I run the game in fullscreen, it will not work in either mode and I can tell the window is deselected because I get a glimpse of it. I can click while the video is playing and the music will start playing but at the begging of the music. Tell me if something is unclear.
Title: Re: Background Music with Video
Post by: Pumaman on Sun 21/12/2008 23:33:16
Ok, so the root cause of this problem is that the game window is not selected when it starts up.

This is not a problem I have seen reported before ... are you running Vista, and does it pop up a message about compatibility mode when you start the game?
Title: Re: Background Music with Video
Post by: joelphilippage on Sun 21/12/2008 23:51:00
I am running it in xp, there are no messages, and it starts out selected and then deselects when the movie starts.
Title: Re: Background Music with Video
Post by: Pumaman on Mon 22/12/2008 19:45:23
Are you running with Direct3D 9 or DirectX 5 driver? Has anyone else had a problem like this? Are you using ffdshow as your divx codec? (it has been known to cause some problems)