Post by sowee15 on Jul 19, 2016 20:22:19 GMT
Hi,
I get this error when I call TriggerPlaylistClip:
C:/buildslave/unity/build/Runtime/Audio/sound/SoundChannel.cpp(343) : Error executing result (An invalid seek position was passed to this function. )
UnityEngine.AudioSource:Play()
DarkTonic.MasterAudio.PlaylistController:FinishLoadingNewSong(AudioClip, AudioPlayType) (at Assets/Plugins/DarkTonic/MasterAudio/Scripts/Utility/PlaylistController.cs:1274)
DarkTonic.MasterAudio.PlaylistController:PlaySong(MusicSetting, AudioPlayType) (at Assets/Plugins/DarkTonic/MasterAudio/Scripts/Utility/PlaylistController.cs:1222)
DarkTonic.MasterAudio.PlaylistController:PlayTheNextSong(AudioPlayType, Boolean) (at Assets/Plugins/DarkTonic/MasterAudio/Scripts/Utility/PlaylistController.cs:778)
DarkTonic.MasterAudio.PlaylistController:PlayNextOrRandom(AudioPlayType) (at Assets/Plugins/DarkTonic/MasterAudio/Scripts/Utility/PlaylistController.cs:1098)
DarkTonic.MasterAudio.PlaylistController:FinishPlaylistInit(Boolean) (at Assets/Plugins/DarkTonic/MasterAudio/Scripts/Utility/PlaylistController.cs:1036)
DarkTonic.MasterAudio.PlaylistController:ChangePlaylist(String, Boolean) (at Assets/Plugins/DarkTonic/MasterAudio/Scripts/Utility/PlaylistController.cs:1019)
DarkTonic.MasterAudio.MasterAudio:ChangePlaylistByName(String, String, Boolean) (at Assets/Plugins/DarkTonic/MasterAudio/Scripts/Singleton/MasterAudio.cs:4921)
DarkTonic.MasterAudio.MasterAudio:ChangePlaylistByName(String, Boolean) (at Assets/Plugins/DarkTonic/MasterAudio/Scripts/Singleton/MasterAudio.cs:4889)
I created two playlists, Main and Fight. Each have 3 clips. The reason I created two playlists is that during normal mode, I play a specific clip (in loop) from the Main playlist depending on the game status, while in fight mode, I play a random clip (in loop) from the Fight playlist. At the beginning of the game I do something like:
Then when entering combat I do:
When the fight is over I run again:
And that's when I get the error above.
Is that the proper way of doing what I want to do? Should I treat the fight music as a sound effect and stop the main music while its looping? Ideally I'd like the fight music to crossfade with the main music when entering combat and vice versa when going back to main mode.
Thanks!
I get this error when I call TriggerPlaylistClip:
C:/buildslave/unity/build/Runtime/Audio/sound/SoundChannel.cpp(343) : Error executing result (An invalid seek position was passed to this function. )
UnityEngine.AudioSource:Play()
DarkTonic.MasterAudio.PlaylistController:FinishLoadingNewSong(AudioClip, AudioPlayType) (at Assets/Plugins/DarkTonic/MasterAudio/Scripts/Utility/PlaylistController.cs:1274)
DarkTonic.MasterAudio.PlaylistController:PlaySong(MusicSetting, AudioPlayType) (at Assets/Plugins/DarkTonic/MasterAudio/Scripts/Utility/PlaylistController.cs:1222)
DarkTonic.MasterAudio.PlaylistController:PlayTheNextSong(AudioPlayType, Boolean) (at Assets/Plugins/DarkTonic/MasterAudio/Scripts/Utility/PlaylistController.cs:778)
DarkTonic.MasterAudio.PlaylistController:PlayNextOrRandom(AudioPlayType) (at Assets/Plugins/DarkTonic/MasterAudio/Scripts/Utility/PlaylistController.cs:1098)
DarkTonic.MasterAudio.PlaylistController:FinishPlaylistInit(Boolean) (at Assets/Plugins/DarkTonic/MasterAudio/Scripts/Utility/PlaylistController.cs:1036)
DarkTonic.MasterAudio.PlaylistController:ChangePlaylist(String, Boolean) (at Assets/Plugins/DarkTonic/MasterAudio/Scripts/Utility/PlaylistController.cs:1019)
DarkTonic.MasterAudio.MasterAudio:ChangePlaylistByName(String, String, Boolean) (at Assets/Plugins/DarkTonic/MasterAudio/Scripts/Singleton/MasterAudio.cs:4921)
DarkTonic.MasterAudio.MasterAudio:ChangePlaylistByName(String, Boolean) (at Assets/Plugins/DarkTonic/MasterAudio/Scripts/Singleton/MasterAudio.cs:4889)
I created two playlists, Main and Fight. Each have 3 clips. The reason I created two playlists is that during normal mode, I play a specific clip (in loop) from the Main playlist depending on the game status, while in fight mode, I play a random clip (in loop) from the Fight playlist. At the beginning of the game I do something like:
MasterAudio.ChangePlaylistByName("Main");
MasterAudio.TriggerPlaylistClip("PartSeven");
Then when entering combat I do:
MasterAudio.ChangePlaylistByName("Fight");
MasterAudio.TriggerRandomPlaylistClip();
When the fight is over I run again:
MasterAudio.ChangePlaylistByName("Main");
MasterAudio.TriggerPlaylistClip("PartSeven");
And that's when I get the error above.
Is that the proper way of doing what I want to do? Should I treat the fight music as a sound effect and stop the main music while its looping? Ideally I'd like the fight music to crossfade with the main music when entering combat and vice versa when going back to main mode.
Thanks!