Play List Action: Difference between revisions

From FSDeveloper Wiki
Jump to navigationJump to search
Line 1: Line 1:
== Warning/Caveats ==
== Warning/Caveats ==


=== Files ===
The soundfile '''must exist''' on the specified path.
The soundfile '''must exist''' on the specified path.


'''If any files are incorrectly referenced, the mission will not load.'''


 
=== Namiing Conventions ===
ENSURE you use an '''appropriate & unique name''' for your sound clip,
ENSURE you use an '''appropriate & unique name''' for your sound clip,
otherwise you'll possibly overwrite someone else's clip.
otherwise you'll possibly overwrite someone else's clip.
i.e.  
i.e.  
Don't use song1.wav, song2.wav, etc.    ;)  
Don't use song1.wav, song2.wav, etc.    ;)  


Prefix the clip with your mission name.
Prefix the clip with your mission name.
e.g.  
e.g.  
MyRescueMission_song1.wav, MyRescueMission_song2.wav, etc
MyRescueMission_song1.wav, MyRescueMission_song2.wav, etc
Line 18: Line 22:
Suggest adding a common subfolder,
Suggest adding a common subfolder,
and that we all adopt that as a common standard.
and that we all adopt that as a common standard.
e.g.  
e.g.  
Microsoft Flight Simulator X\Sound\Mission_Playlists
Microsoft Flight Simulator X\Sound\Mission_Playlists


And that you place your soundfiles in mission specific subfolders.
And that you place your soundfiles in mission specific subfolders.
e.g.  
e.g.  
Microsoft Flight Simulator X\Sound\Mission_Playlists\MyRescueMission
Microsoft Flight Simulator X\Sound\Mission_Playlists\MyRescueMission

Revision as of 05:08, 24 March 2007

Warning/Caveats

Files

The soundfile must exist on the specified path.

If any files are incorrectly referenced, the mission will not load.

Namiing Conventions

ENSURE you use an appropriate & unique name for your sound clip, otherwise you'll possibly overwrite someone else's clip.

i.e. Don't use song1.wav, song2.wav, etc.  ;)

Prefix the clip with your mission name.

e.g. MyRescueMission_song1.wav, MyRescueMission_song2.wav, etc


Suggest adding a common subfolder, and that we all adopt that as a common standard.

e.g. Microsoft Flight Simulator X\Sound\Mission_Playlists

And that you place your soundfiles in mission specific subfolders.

e.g. Microsoft Flight Simulator X\Sound\Mission_Playlists\MyRescueMission

In six months time, or whenever, a user may find themselves short on diskspace, and don't know which files to delete.


Ensure your soundfile is an appropriate format, (radio quality, as maximum), and of a smallish size.

Nobody wants to download 600MB of your favourite music. :D

You can play a clip indefinitely by repeating it, using multiple calls in the playlist.

See example clips in Microsoft Flight Simulator X\Sound\UIMusic


Supported Filetypes

WAV files are apparently the only type supported.

Some formats of WAV files will not play correctly -

Microsoft ADPCM 11.025 kHz, 4 Bit, Mono is NOT supported, hence in the example I've posted, the odd sounding thunder, & speeded up dialog on the second playlist.

PCM 22.050 kHz, 16 Bit, Mono, and MP3, WMA, are not supported.


Testing your playlists

If you fire a playlist,

then exit or reload the mission,

before the playlist is completed.

The interupted track & remaining playlist tracks will continue to play !

Example Code

It plays two different short playlists, using sounds & UIMusic which already exist in your FSX.

A 5 second timer activates -

a) the first playlist.

b) a 60 second timer, which then fires the second playlist.

NB

For readability this code is laid out in order of firing, and will work as is.

If added to a mission, the OPT will re-order it.

On screen notices & timers are included for test purposes.

       <SimMission.TimerTrigger InstanceId="{A8498446-0335-4E76-BB37-82B9AEAD1A76}">
           <Descr>_Init_TTimer_S5</Descr>
           <StopTime>5.000</StopTime>
           <OnScreenTimer>True</OnScreenTimer>
           <Actions>
               <ObjectReference id="_Triggered_TTimer_S120_AA_On" InstanceId="{35CE0E66-F666-4E9C-8CCD-929C54BCE3C7}">
               </ObjectReference>
               <ObjectReference id="_First_PLAYLIST_DIALOG_AD" InstanceId="{D3BDAB41-B690-499F-B63D-1ECDAB56C1AA}">
               </ObjectReference>
               <ObjectReference id="_First_PLAYLIST_AP" InstanceId="{6DA689F9-67C1-49BD-AD95-3A633E428709}">
               </ObjectReference>
           </Actions>
       </SimMission.TimerTrigger>
       <SimMission.ObjectActivationAction InstanceId="{35CE0E66-F666-4E9C-8CCD-929C54BCE3C7}">
           <Descr>_Triggered_TTimer_S120_AA_On</Descr>
           <ObjectReferenceList>
               <ObjectReference id="_Triggered_TTimer_S60" InstanceId="{860011FB-F217-4FEF-BE94-C33C4F648AE9}">
               </ObjectReference>
           </ObjectReferenceList>
       </SimMission.ObjectActivationAction>
       <SimMission.DialogAction InstanceId="{D3BDAB41-B690-499F-B63D-1ECDAB56C1AA}">
           <Descr>_First_PLAYLIST_DIALOG_AD</Descr>
           <Text>5 second Timer activated _First_PLAYLIST_AP</Text>
       </SimMission.DialogAction>
       <SimMission.PlayListAction InstanceId="{6DA689F9-67C1-49BD-AD95-3A633E428709}">
           <Descr>_First_PLAYLIST_AP</Descr>
           <PlayListItem>
               <Descr>PlayListItem 1</Descr>
               <SoundFileName>MRSDAHL.wav</SoundFileName>
               <RandomizeInList>True</RandomizeInList>
           </PlayListItem>
           <PlayListItem>
               <Descr>PlayListItem 2</Descr>
               <SoundFileName>backcourse_marker.wav</SoundFileName>
               <RandomizeInList>True</RandomizeInList>
           </PlayListItem>
           <PlayListItem>
               <Descr>PlayListItem 3</Descr>
               <SoundFileName>UIMusic\FSX08.wav</SoundFileName>
           </PlayListItem>
       </SimMission.PlayListAction>



       <SimMission.TimerTrigger InstanceId="{860011FB-F217-4FEF-BE94-C33C4F648AE9}">
           <Descr>_Triggered_TTimer_S60</Descr>
           <StopTime>60.000</StopTime>
	    <Activated>False</Activated>
           <OnScreenTimer>True</OnScreenTimer>
           <Actions>
               <ObjectReference id="_Second_PLAYLIST_DIALOG_AD" InstanceId="{7808D1CE-FFDB-4727-A05E-093DB452DB0C}">
               </ObjectReference>
               <ObjectReference id="_Second_PLAYLIST_AP" InstanceId="{E768BFC8-F32E-450D-B095-C23F819AFD31}">
               </ObjectReference>
           </Actions>
       </SimMission.TimerTrigger>
       <SimMission.DialogAction InstanceId="{7808D1CE-FFDB-4727-A05E-093DB452DB0C}">
           <Descr>_Second_PLAYLIST_DIALOG_AD</Descr>
           <Text>60 second Timer activated _Second_PLAYLIST_AP</Text>
       </SimMission.DialogAction>
       <SimMission.PlayListAction InstanceId="{E768BFC8-F32E-450D-B095-C23F819AFD31}">
           <Descr>_Second_PLAYLIST_AP</Descr>
           <PlayListItem>
               <Descr>PlayListItem 1</Descr>
               <SoundFileName>thunder\xthun4c.wav</SoundFileName>
           </PlayListItem>
           <PlayListItem>
               <Descr>PlayListItem 2</Descr>
               <SoundFileName>lessons\atpding39.wav</SoundFileName>
           </PlayListItem>
           <PlayListItem>
               <Descr>PlayListItem 3</Descr>
               <SoundFileName>UIMusic\FSX03.wav</SoundFileName>
           </PlayListItem>
       </SimMission.PlayListAction>