Unable to stream sound files (StreamMusic and PlayMusicFile)

Post » Thu Apr 14, 2011 11:43 pm

Dear all,

I already posted this in the tesnexus forum, but received no answers yet. So I start a second try here.

I have strange problems getting sound files to play, no matter whether I am using the vanilla http://cs.elderscrolls.com/constwiki/index.php/StreamMusic function or the more sophisticated "PlayMusicFile" function from scantis http://cs.elderscrolls.com/constwiki/index.php/Category:SoundCommands add-on.
I know that there are many open issues related to StreamMusic, and I have spent some time scanning other posts on this topic here, but I think that my problem is not covered.
I am wondering if anybody has faced this issue, too.

At first I thought this would be a problem of StreamMusic only, but it doesn't work with PlayMusicFile either.
So I guess there must be some issue with file paths, though I can't find the clue.

What I do looks like this (both alternatives I have tested):

StreamMusic "Data\Music\MyMusic\MyMusicFile.mp3"
or
PlayMusicFile "Data\Music\MyMusic\MyMusicFile.mp3"


The code is executed from within a quest script in the "gameMode" block, once whenever the player enters the specific cell.

I always face the same effect:
With StreamMusic, the current music, that was playing before, fades out, pauses for some seconds, and then another track from the same type (public, dungeon or default, depending what is defined for the cell) starts playing again. According to the documentation, this should only happen when the track to play cannot be found, e.g. due to an invalid filename or path.
With PlayMusicFile, nothing happens at all. I suppose that the reason in both cases is the same.

After hours of experimenting, I don't know what might cause this. I tried everything I could imagine to exclude whatever reason comes to my mind:

- I am absolutely sure that my file path is correct! I tried every possible combination, including both full and relative paths, both upper and lower case directory names, both custom and vanilla sound files, both forward and backward slashes, both mp3 and wav files etc.
- I also checked this on three different computers, always with the same effect.
- My sound system in general is working fine, I am even using BetterMusicSystem and SoundCommands without any issues, so I suppose that this is not a general sound problem. Disabling BetterMusicSystem and SoundCommands doesn't help either.
- I checked for all types of cell music (Public, Dungeon, Default).
- I also tried the workaround for "Default" type cells, which is explained in the documentation (in the TES CS Wiki, as linked above) for StreamMusic (i.e. call StreeamMusic random, then wait for some frames, then call StreamMusic ). This showed exactly the same behaviour (fade out - pause - fade in of the next random track). But the cell in which I need to stream my custom file is of type "Public" anyway.
- Inside the cell which I am talking about, there's absolutely no enemy, no combat, no teleporting, load dorrs or whatever. This means, any of the well-known reasons that cause StreamMusic to interrrupt (i.e. combat, change cell etc.) cannot be the reason of the problem.

In conclusion, I suppose that for some very very weird reason my game engine can't find the sound files. but please note again that it makes no difference if I try to start a custom or one of the plain vanilla sound files. So I guess it's not the files, but rather something related to the paths. But I don't know...

Can anybody help me?
User avatar
adame
 
Posts: 3454
Joined: Wed Aug 29, 2007 2:57 am

Post » Thu Apr 14, 2011 10:56 pm

...

In my case the PlayMusicFile doesn't work, because I have "Unsupported Oblivion version". The following text is from my SoundCommands.log -file:
loading SoundCommands
Unsupported Oblivion version, will disable commands.
I have the non-cracked SI version of 1.2.0.416. Odd.
User avatar
Eoh
 
Posts: 3378
Joined: Sun Mar 18, 2007 6:03 pm

Post » Fri Apr 15, 2011 3:45 am

In my case the PlayMusicFile doesn't work, because I have "Unsupported Oblivion version". The following text is from my SoundCommands.log -file:I have the non-cracked SI version of 1.2.0.416. Odd.


Hi Sami_!

You got it: I have exactly the same entry in the log:
loading SoundCommands
Unsupported Oblivion version, will disable commands.

Didn't notice that before, so thanks for the hint!!
This is really weird. I think i should go on finding out what SoundCommands is doing there.

However, I think that this is probably not the basic problem, as StreamMusic won't work either.
User avatar
Kayleigh Mcneil
 
Posts: 3352
Joined: Thu Jun 29, 2006 7:32 am

Post » Thu Apr 14, 2011 6:50 pm

Hi Sami_!

You got it: I have exactly the same entry in the log:
loading SoundCommands
Unsupported Oblivion version, will disable commands.

Didn't notice that before, so thanks for the hint!!
This is really weird. I think i should go on finding out what SoundCommands is doing there.

However, I think that this is probably not the basic problem, as StreamMusic won't work either.

StreamMusic might not work at all if the music is set to default in the cell properties window. If it is Dungeon- or Public music it might work. The following script worked for me, but as soon as it is done playing, it will change into Vanilla music. Also, you shouldn't be in the cell when loading the game.
Spoiler
ScN StreamMusicScriptfloat TimerBegin onload   set Timer to [length of the music file]endBegin GameMode   if timer >= [length of the music file]      StreamMusic "music\[insert folder name]\[insert filename].mp3"      set timer to 0   else      set timer to ( timer + GetSecondsPassed )   endifend

User avatar
adam holden
 
Posts: 3339
Joined: Tue Jun 19, 2007 9:34 pm

Post » Thu Apr 14, 2011 6:37 pm

StreamMusic might not work at all if the music is set to default in the cell properties window. If it is Dungeon- or Public music it might work. The following script worked for me, but as soon as it is done playing, it will change into Vanilla music. Also, you shouldn't be in the cell when loading the game.

My cell which won't work is of type "Public", so I think this isn't the problem. I am also entering the cell from another cell when testing.

However, your script showed my that I didn't consider at all the most important thing: Your timer code tells me (for the first time) that I need to call StreamMusic repeatedly as long as the track needs to run, is that right? As this is not mentioned at all in the documentation, I completely misunderstood the command in that point, thinking that I'd only have to call it once to start a track. So thank you very much for this hint!! This may exclude one possible reason, at least!

Unfortunately, the problem prevails! :( I have implemented a timer, which is running fine (I have debugged everything second by second with Conscribe, so I can be sure that StreamMusic is now called nearly every second, exactly as long as it should). But still I can't hear my custom track, instead, after some seconds, another random track from "Public" starts playing (i.e. same behaviour as before), though my timer is still running, and StreamMusic gets executed all the time.

But this lead me to another idea:
I have EnhancedMusicControl installed in my OBSE Plugins directory (because I am using BetterMusicSystem). Though BMS is disabled while testing, I suppose that EMC still might be a reason for my problem. So I tried to disable it by deleting the EnhancedMusicControl.dll file from the OBSE Plugin folder. But now my game won't play any background music anymore!! None at all.

So my next issue is now: How can I UNinstall EMC properly??

Does anybody have experience with that?

EDIT: I don't know why the quote above isn't displayed correctly? Have I mistyped anything? Or is this a current forum bug?
User avatar
Meghan Terry
 
Posts: 3414
Joined: Sun Aug 12, 2007 11:53 am

Post » Fri Apr 15, 2011 12:30 am

EDIT: I don't know why the quote above isn't displayed correctly? Have I mistyped anything? Or is this a current forum bug?

The quote blocks are quote and /quote. However, for some reason, your /quote is written /qote :D
User avatar
Laura Samson
 
Posts: 3337
Joined: Wed Aug 29, 2007 6:36 pm

Post » Fri Apr 15, 2011 1:31 am

The quote blocks are quote and /quote. However, for some reason, your /quote is written /qote :D

OMG... seems to be too early in the morning! Thanks! ;-) (already fixed it)
User avatar
LittleMiss
 
Posts: 3412
Joined: Wed Nov 29, 2006 6:22 am

Post » Thu Apr 14, 2011 7:05 pm

All right then... the problem is SOLVED! :intergalactic:

Although the solution was based on my misunderstanding and appears now (at least 90%) logical to me, it wasn't simple.
For anyone running into the same problems, here's the summary.

At first, I didn't consider that I had installed HawkleyFox's http://www.tesnexus.com/downloads/file.php?id=19772 together with side777's http://www.tesnexus.com/downloads/file.php?id=26892. I didn't realize that simply disabling the BMS esp files does NOT disable EMC. Instead, EMC still works in the background, forcing its own control over the music onto the game engine.

When I found the information that the StreamMusic command does generall NOT work together with EMC (see http://www.thenexusforums.com/index.php?/topic/74670-enhanced-music-control/page__view__findpost__p__774621), I understood why I can't get it playing.

Instead, the only (and much more powerful) way to play custom tracks with EMC is to build a playlist with EMC's OBSE functions, as described http://www.thenexusforums.com/index.php?/topic/74670-enhanced-music-control.

After all, I managed to implement the required code, and now everything works as expected.

While EMC is definitely the reason for StreamMusic not working, I am still not sure why the PlayMusicFile command from scanti's http://www.tesnexus.com/downloads/file.php?id=16288 plugin doesn't work either. I tend to assume that EMC blocks this as well, though this appears strange to me, because SC (apart from EMC) is a part of BMS as well. I'd expect that these two plugins should collaborate fine within BMS. But maybe I am wrong.

I wanted to check this by disabling EMC, in order to see what happens then. But unfortunately I didn't manage to cleanly unistall it, which is a bit annoying and still not resolved (see http://www.gamesas.com/index.php?/topic/1106507-unable-to-uninstall-enhancedmusiccontrol/).

For me and my mod's code, this all means:

- I have managed to get the desired track playing with EMC. This is tested successfully! Great!
- I check whether EMC and SoundCommands are installed via isPluginInstalled "Enhanced_Music_Control" and isPluginInstalled "SoundCommands"
- if only SoundCommands is installed, I use SoundCommands, but I couldn't test this because I can't get EMC disabled
- if SC isn't installed either, I use StreamMusic, but this isn't tested for the same reason.

However, I think I am happy with this!

@Sami_: Thanks anyway for your help! :)
User avatar
butterfly
 
Posts: 3467
Joined: Wed Aug 16, 2006 8:20 pm

Post » Fri Apr 15, 2011 3:35 am

@Sami_: Thanks anyway for your help! :)

Yeah, sure, anytime :D Glad you got it solved.
User avatar
Samantha hulme
 
Posts: 3373
Joined: Wed Jun 21, 2006 4:22 pm

Post » Fri Apr 15, 2011 7:47 am

Yeah, sure, anytime :D Glad you got it solved.


Unfortunately, another issue has emerged now:
With BMS enabled again, my fantastic solution described above fails completely! :(
It seems that BMS takes absolute precedence over any other custom EMC code: When I try to change the playlist at runtime, as described above, everything seems to work fine at first, i.e. the current music fades out, then (according to the log output) my custom playlist gets created successfully, then the changePlaylist command gets executed (also without errors)... but then... I just don't hear my own track. Instead, BMS switches back to another playlists and fades in one of its own tracks.

In other words: The playlist logic of BMS (i.e. its detection, which track to play in which kind of cell etc., as it is configured in BetterMusicSystem.ini) simply overrules my own mod!
I have tried around alot with
- changing the load order
- changing BetterMusicSystem.ini settings
- increasing my mod's priority to 90

... but nothing of this seems to help.

As a result, I have exactly the same problem as right from the start! All my efforts to switch to a custom track are simply NOT possible in combination with BMS.

That's a pity :(:( Don't know what else I could do... maybe I'll try to post this in one of the more BMS specific threads...
User avatar
Sami Blackburn
 
Posts: 3306
Joined: Tue Jun 20, 2006 7:56 am

Post » Thu Apr 14, 2011 8:43 pm

While EMC is definitely the reason for StreamMusic not working, I am still not sure why the PlayMusicFile command from scanti's SoundCommands (SC) plugin doesn't work either. I tend to assume that EMC blocks this as well, though this appears strange to me, because SC (apart from EMC) is a part of BMS as well. I'd expect that these two plugins should collaborate fine within BMS. But maybe I am wrong.

I wanted to check this by disabling EMC, in order to see what happens then. But unfortunately I didn't manage to cleanly unistall it, which is a bit annoying and still not resolved (see this thread).

I also must thank you for solving my problem :D EMC really IS the source of all sound bugs. After disabling it by removing it's plugin from the obse\plugins -folder, both StreamMusic and PlayMusicFile worked fine. And all this time I thought it was script related, or that there was something wrong with my sound files :D
User avatar
Tom Flanagan
 
Posts: 3522
Joined: Sat Jul 21, 2007 1:51 am

Post » Fri Apr 15, 2011 1:07 am

I also must thank you for solving my problem :D EMC really IS the source of all sound bugs. After disabling it by removing it's plugin from the obse\plugins -folder, both StreamMusic and PlayMusicFile worked fine. And all this time I thought it was script related, or that there was something wrong with my sound files :D

Well, that's nice to hear! :foodndrink:
Though it seems that you had much better success in disabling EMC than I had, as you might already have read http://www.gamesas.com/index.php?/topic/1106507-unable-to-uninstall-enhancedmusiccontrol/.
I haven't managed yet to "get rid of it" (at least temporarily, for testing) without completely breaking my ingame music.

BTW, I have now posted my "new" BMS/EMC problem described above http://www.gamesas.com/index.php?/topic/1106593-bettermusicsystem-overrules-enhancedmusiccontrol-commands/.
User avatar
laila hassan
 
Posts: 3476
Joined: Mon Oct 09, 2006 2:53 pm

Post » Thu Apr 14, 2011 5:29 pm

Just an addition, for anyone interested in solving similar issues:

There are now two TES CS Wiki articles that try to summarize the problem of and the possible solution for streaming custom music in relation with StreamMusic, SoundCommads, Enhanced Music Controls and Better Music System:
- http://cs.elderscrolls.com/constwiki/index.php/Playing_custom_background_music
- http://cs.elderscrolls.com/constwiki/index.php/Defining_cell-specific_playlists_for_Better_Music_System
User avatar
Star Dunkels Macmillan
 
Posts: 3421
Joined: Thu Aug 31, 2006 4:00 pm


Return to IV - Oblivion