Advertisement
TechOFreak

Episode 22 Functions

Dec 23rd, 2020
1,419
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.87 KB | None | 0 0
  1. //From my Amnesia Rebirth Tutorial Series
  2. //Episode 21 Music!
  3. //https://www.youtube.com/playlist?list=PL4KkjlmOwLwwMVqedCNpi6caUxhgyf8Qr
  4. //-----------------------------------------------------------
  5.  
  6. /////////////////////////////////////////////////////////
  7. //Make sure you add a new directory path to your custom story called music...
  8. //In your resources file in your custom story folder add <Directory Path="/music" AddSubDirs="true"/>
  9. //This is only nesessary if you plan on playing your own music
  10. /////////////////////////////////////////////////////////
  11.  
  12. //Play any track that is in the core game or any music located in folders that you've added to the directory
  13. Music_Play("test.mp3", 1.0f, true, eMusicPrio_BgAmb);
  14. //fileName (String)- can also be a path to a folder that is within an added directory.
  15. //volume (float)- volume of the track between 0.0 and 1.0 where 0.0 is 0% volume and 1.0 is 100% volume.
  16. //loop (bool)- whether or not the track should loop.
  17. //musicPriority (eMusicPrio)- the priority that should be placed on this track. (Type eMusicPrio_ to see all priorities, use eMusicPrio_BgAmb for ambience music)
  18.  
  19. //Play any song that is in the core game or any music located in folders that you've added to the directory (this version of the function allows for additional configuration)
  20. Music_PlayExt("test.mp3", true, 0.1f, 1.0f, 2.0f, 1.0f, eMusicPrio_BgAmb, true);
  21. //fileName (String)- can also be a path to a folder that is within an added directory.
  22. //loop (bool)- whether or not the track should loop.
  23. //volume (float)- volume of the track between 0.0 and 1.0 where 0.0 is 0% volume and 1.0 is 100% volume.
  24. //frequency (float)- speed up or slow down the track (1.0 is normal speed).
  25. //volumeFadeTime (float)- time it should take to fade in the volume to the specified amount.
  26. //frequencyFadeTime (float)- time it should take to fade in the frequency to the specified amount.
  27. //musicPriority (eMusicPrio)- the priority that should be placed on this track. (Type eMusicPrio_ to see all priorities, use eMusicPrio_BgAmb for ambience music)
  28. //allowResume (bool)- should the track resume where it left off if true then the next time the song is played it will resume at the same point it stopped instead of restarting the track.
  29.  
  30. //Play any track over a track that is currently playing
  31. Music_PlayOverlay("test.mp3", 0.3f);
  32. //fileName (String)- can also be a path to a folder that is within an added directory.
  33. //volume (float)- volume of the track between 0.0 and 1.0 where 0.0 is 0% volume and 1.0 is 100% volume.
  34.  
  35. //Stop a track playing on a specific priority
  36. Music_Stop(1.0f, eMusicPrio_BgAmb);
  37. //trackFadeTime (float)- time it should take to fade away the track.
  38. //musicPriority (eMusicPrio)- the priority of the track that should be stopped.
  39.  
  40. //Stop all currently playing tracks
  41. Music_StopAll(1.0f);
  42. //trackFadeTime (float)- time it should take to fade away all the tracks.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement