StreamMusic

From the Oblivion ConstructionSet Wiki
Revision as of 19:41, 27 December 2015 by imported>Forli (Added informations about the changes made to this command by the plugin EMC2.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Description

Tells the game to start playing a new track or play a specific music file.


Syntax:

StreamMusic "<Filename>"     play the specified file (The quotes are required!)

StreamMusic Public           play a random track out of Data\Music\Public 
StreamMusic Explore          play a random track out of Data\Music\Explore
StreamMusic Dungeon          play a random track out of Data\Music\Dungeon
StreamMusic Battle           play a random track out of Data\Music\Battle (requires: EMC2)
StreamMusic Random           play a random track out of one of the three/four folders above 


Examples:

StreamMusic "data\music\special\success.mp3"
StreamMusic "LauncherMusic.wav"
StreamMusic "..\Morrowind\Data Files\Music\Special\morrowind title.mp3"
StreamMusic "C:\WINDOWS\Media\tada.wav"



Some Notes:

  • This Function was not documented by Bethesda, and it seems to be partly broken/unfinished so always keep an eye open for strange behaviors or "new" features.
  • At the end of the file, a new random music will be chosen according to the current location.
  • Providing a filename that doesn't exist causes the game to restart the song that is currently playing.
  • StreamMusic works fine in cells with the music type set to either "Dungeon" or "Public" When used in a "Default" cell, StreamMusic only restarts the current track.
  • To use this command in a cell with music-type "Default", you need to call StreamMusic random first, then wait for a frame for the command to be executed, and then use Streammusic "<filename>"
  • StreamMusic will also not override combat music, the combat-music that is currently playing will be restarted, though.
  • The filename is relative to the Oblivion-folder it doesn't need to be in Data\Music.
  • The file-type isn't restricted to MP3. Any format that may be played by Windows Media Player can also be played by Oblivion (e.g .MID files). However, when an attempt is made to play a playlist file (.m3u, .pls, etc.) any existing music stops and nothing plays.
  • The file-type isn't even restricted to music; if you start a video this way, Oblivion will minimize and play the video in an extra window. When the video ends, Oblivion will resume. (This is bound to make the game instable, so don't use it for anything but easter-eggs.)
  • Scanti's OBSE Sound Commands plugin includes a PlayMusicFile command which avoids some of the issues with StreamMusic.
  • StreamMusic does not work while HawkleyFox's OBSE plugin Enhanced Music and Control (EMC) is installed. As EMC is a requirement for running BetterMusicSystem (BMS), StreamMusic will probably not work together with BMS.
  • This command is altered by the plugin Enhanced Music and Control 2 (EMC2) in order to solve the compatibility issue caused by EMC2 itself. StreamMusic maintains all its features (except for the ability to play videos, which causes problems anyway), but it can now use * and ? regex characters in the filepath, can use the Battle keyword too (to play a random battle track), and all above issues are fixed.
  • If you want to stream specific tracks in specific cells of your own mod, relying on StreamMusic alone is not a good approach, because many users will have either SoundCommands installed, or Enhanced Music Controls, or Better Music System, or even a combination of them. The best approach is to use OBSE function IsPluginInstalled to detect which of these plugins are installed, and then use the appropriate commands to start your track. There are tutorials about how to do this (see the two linked articles below).

See Also