-
-
Notifications
You must be signed in to change notification settings - Fork 10
sound.CreateMusicFromFile
Jérôme Leclercq edited this page Dec 8, 2020
·
2 revisions
API: sound.CreateMusicFromFile
Opens a music from a file path.
sound.CreateMusicFromFile(filePath: string) -> music: Music | nil, err: string
-
filepath: Path to the image file (relative to the resources directory).
-
music: Music object opened from the file path ornilif the opening failed. -
err: Ifmusicis nil, an error message containing the reason this function failed.
- This function will fail if the image file has not been registered server-side using RegisterClientAssets, independently from the file existence on the host filesystem.
- Contrary to functions like assets.GetTexture, this function will always instantiate a new Music every call, even if another one already exists.
- Only the following extensions are supported:
- aiff
- au
- avr
- caf
- flac
- htk
- ircam
- mat4
- mat5
- mpc2k
- nist
- ogg
- pvf
- raw
- rf64
- sd2
- sds
- svx
- voc
- w64
- wav
- wve