@quenty/sounds 6.7.0 → 6.7.1-canary.385.c37a0ad.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/package.json +5 -4
- package/src/Shared/SoundUtils.lua +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [6.7.1-canary.385.c37a0ad.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/sounds@6.7.0...@quenty/sounds@6.7.1-canary.385.c37a0ad.0) (2023-07-10)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Use RbxAssetId package for SoundUtils ([097438e](https://github.com/Quenty/NevermoreEngine/commit/097438ed87e54c37212c421a58656711598dddb1))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [6.7.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/sounds@6.6.0...@quenty/sounds@6.7.0) (2023-06-17)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @quenty/sounds
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/sounds",
|
|
3
|
-
"version": "6.7.0",
|
|
3
|
+
"version": "6.7.1-canary.385.c37a0ad.0",
|
|
4
4
|
"description": "Utility functions involving sounds and their state",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -26,11 +26,12 @@
|
|
|
26
26
|
"Quenty"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@quenty/loader": "
|
|
30
|
-
"@quenty/promise": "
|
|
29
|
+
"@quenty/loader": "6.2.1",
|
|
30
|
+
"@quenty/promise": "6.6.0",
|
|
31
|
+
"@quenty/rbxasset": "1.0.1-canary.385.c37a0ad.0"
|
|
31
32
|
},
|
|
32
33
|
"publishConfig": {
|
|
33
34
|
"access": "public"
|
|
34
35
|
},
|
|
35
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "c37a0ad3981a0e27d4d9db436a0f21e675b12bf0"
|
|
36
37
|
}
|
|
@@ -14,6 +14,7 @@ local SoundService = game:GetService("SoundService")
|
|
|
14
14
|
local RunService = game:GetService("RunService")
|
|
15
15
|
|
|
16
16
|
local SoundPromiseUtils = require("SoundPromiseUtils")
|
|
17
|
+
local RbxAssetUtils = require("RbxAssetUtils")
|
|
17
18
|
|
|
18
19
|
local SoundUtils = {}
|
|
19
20
|
|
|
@@ -32,7 +33,7 @@ local SoundUtils = {}
|
|
|
32
33
|
@return Sound
|
|
33
34
|
]=]
|
|
34
35
|
function SoundUtils.playFromId(id: string | number): Sound
|
|
35
|
-
local soundId =
|
|
36
|
+
local soundId = RbxAssetUtils.toRbxAssetId(id)
|
|
36
37
|
assert(type(soundId) == "string", "Bad id")
|
|
37
38
|
|
|
38
39
|
local sound = SoundUtils.createSoundFromId(id)
|
|
@@ -52,7 +53,7 @@ end
|
|
|
52
53
|
Creates a new sound object from the given id
|
|
53
54
|
]=]
|
|
54
55
|
function SoundUtils.createSoundFromId(id: string | number): Sound
|
|
55
|
-
local soundId =
|
|
56
|
+
local soundId = RbxAssetUtils.toRbxAssetId(id)
|
|
56
57
|
assert(type(soundId) == "string", "Bad id")
|
|
57
58
|
|
|
58
59
|
local sound = Instance.new("Sound")
|
|
@@ -128,16 +129,15 @@ end
|
|
|
128
129
|
|
|
129
130
|
--[=[
|
|
130
131
|
Converts a string or number to a string for playback.
|
|
132
|
+
|
|
133
|
+
Alias of [RbxAssetUtils.toRbxAssetId] for backwards compatibility.
|
|
134
|
+
|
|
135
|
+
@function toRbxAssetId
|
|
131
136
|
@param id string? | number
|
|
132
137
|
@return string?
|
|
138
|
+
@within SoundUtils
|
|
133
139
|
]=]
|
|
134
|
-
|
|
135
|
-
if type(id) == "number" then
|
|
136
|
-
return ("rbxassetid://%d"):format(id)
|
|
137
|
-
else
|
|
138
|
-
return id
|
|
139
|
-
end
|
|
140
|
-
end
|
|
140
|
+
SoundUtils.toRbxAssetId = RbxAssetUtils.toRbxAssetId
|
|
141
141
|
|
|
142
142
|
--[=[
|
|
143
143
|
Plays back a sound template in a specific parent.
|