StreamMusic
Revision as of 16:49, 8 August 2010 by imported>Jaime74
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 Random play a random track out of one of the three 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.
- 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
- PlaySound
- PlaySound3D
- Playing custom background music (Tutorial)
- Defining cell-specific playlists for Better Music System (Tutorial)