diff options
author | Nemrav <50055236+Nemrav@users.noreply.github.com> | 2024-08-06 01:48:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-06 01:48:36 +0200 |
commit | 82b16bcca7c74607a8885b882ec36f5202e7ef70 (patch) | |
tree | 0a9bd4f52c01315c3b38ce641a78c33bd8562be2 /game/src/Game/MusicConductor/SongInfo.gd | |
parent | fde15e554dc9ed458a838683c69d10262764db12 (diff) | |
parent | 9506f4160f0bd351f0853e6e8263ea927d9ec771 (diff) |
Merge pull request #243 from Nemrav/music
Music and sound effects
Diffstat (limited to 'game/src/Game/MusicConductor/SongInfo.gd')
-rw-r--r-- | game/src/Game/MusicConductor/SongInfo.gd | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/game/src/Game/MusicConductor/SongInfo.gd b/game/src/Game/MusicConductor/SongInfo.gd index abcf120..527f618 100644 --- a/game/src/Game/MusicConductor/SongInfo.gd +++ b/game/src/Game/MusicConductor/SongInfo.gd @@ -3,9 +3,16 @@ class_name SongInfo var song_path : String = "" var song_name : String = "" -var song_stream : Resource +var song_stream : AudioStream -func _init(dirname:String, fname:String) -> void: +#Initialize from a file path +func init_file_path(dirname : String, fname : String) -> void: song_path = dirname.path_join(fname) song_name = fname.get_basename().replace("_", " ") song_stream = load(song_path) + +#Initialize from an audio stream +func init_stream(dirpath : String, name : String, stream : AudioStream) -> void: + song_path = dirpath + song_name = name + song_stream = stream |