YouTube2Text

Roblox Audio Analyzer Is Really Great... — Transcript

by Paul1Rb · 2,301 words · 305 segments · language en · Watch on YouTube

Full transcript

  1. 0:00so Roblox has fixed the audio analyzer
  2. 0:02from the new audio API and this was an
  3. 0:04information brought to me in the
  4. 0:05comments by one of you guys so I'm going
  5. 0:07to make a video on it but as usual leave
  6. 0:09a like And subscribe to support the
  7. 0:10channel and let's get to it so the first
  8. 0:12thing I need to mention is that the
  9. 0:13audio API is still a beta feature and
  10. 0:16it's not recommended to use it in live
  11. 0:18games but to enable it you need to go
  12. 0:20into file then beta features and then
  13. 0:23scroll down to the new audio API right
  14. 0:25here then press on Save restart studio
  15. 0:27and you will be able to use the new
  16. 0:29audio API instances and now let just
  17. 0:31talk about setting everything up so
  18. 0:33unlike the normal sound instances for
  19. 0:35the audio API we need something called
  20. 0:37an audio player so I'm just actually
  21. 0:39going to insert a
  22. 0:41part and just make it enchor and I'm
  23. 0:44going to do this in a separate folder so
  24. 0:47this part is going to be the player part
  25. 0:50and I'm just going to make it green to
  26. 0:52separate it a little bit better because
  27. 0:54like I said to play a sound from the
  28. 0:55audio API we need to insert the audio
  29. 0:57player instance into the part and then
  30. 1:00we want to put it a song audio ID or
  31. 1:02whatever into the asset ID property and
  32. 1:06I'm just going to use this audio for the
  33. 1:09video this is a free sound that's
  34. 1:11uploaded by Roblox onto the platform so
  35. 1:13I'm just going to fiercely insert the
  36. 1:15instance and just copy the sound ID from
  37. 1:17right here then just paste it into the
  38. 1:20asset ID and then just remove the sound
  39. 1:23instance so now we have something that
  40. 1:25will play the audio but we also need
  41. 1:27something that will emit it into the
  42. 1:29word
  43. 1:30so I'm just going to duplicate this part
  44. 1:32and fly before adding an audio emitter
  45. 1:34I'm going to add an audio fader and this
  46. 1:37part is going to be named fader part and
  47. 1:40you don't have to set everything like I
  48. 1:41do in this video I'm just doing this for
  49. 1:43Simplicity but after we get the audio
  50. 1:46fader we also need an audio
  51. 1:48emitter so this is going to be the
  52. 1:50emitter
  53. 1:51part and it will use the audio emitter
  54. 1:55and really quickly I'm just going to
  55. 1:56make a folder and name IT wires
  56. 2:02because to connect the audio player to
  57. 2:04the audio fader then the audio fader to
  58. 2:06the audio emitter we need to use a wire
  59. 2:09for that where this wire is going to be
  60. 2:11the player into fader so we select the
  61. 2:15source instance to be the other player
  62. 2:19and the target instance to be the audio
  63. 2:22fader then add another wire this one is
  64. 2:25going to be the fader into emitter so
  65. 2:28just select the audio fader in to the
  66. 2:30audio
  67. 2:31emitter and now if you just add a script
  68. 2:33into the audio analyzer folder and
  69. 2:36change its run context to be on the
  70. 2:38client because this doesn't have to be
  71. 2:41done on the server I'm just going to
  72. 2:42make a line of code to the reference to
  73. 2:45the audio player and here I'm just going
  74. 2:47to do audio player and then the play
  75. 2:50Method as well as change the loop
  76. 2:52property to be on through so this is
  77. 2:55basically going to play our audio but we
  78. 2:58are not going to be able to hear it
  79. 3:00if I just do a play test and come close
  80. 3:02to this part there is going to be no
  81. 3:04audio track that we can actually hear
  82. 3:07and that's because we need some kind of
  83. 3:08a listener that we can create by adding
  84. 3:11a local script into the starter player
  85. 3:17scripts where this one is going to be
  86. 3:19called ad
  87. 3:21listener and all the script is going to
  88. 3:24do this is going to create an audio
  89. 3:26listener that's going to listen to any
  90. 3:28audio emitting from the word so local
  91. 3:31listener is equal to a new instance
  92. 3:33audio listener and I'm also going to
  93. 3:35make a reference to the camera because
  94. 3:37we're going to put the audio listener
  95. 3:39inside of the camera then you to change
  96. 3:41the listener. parent is equal to the
  97. 3:43camera and then we need to create an
  98. 3:45audio device output because this
  99. 3:47listener needs to stream the audio into
  100. 3:50our device so I do local audio device is
  101. 3:53equal to instance at new and then audio
  102. 3:55device output then we can set the parent
  103. 3:58to be the listener and then we just need
  104. 4:00to connect them Through the Wire where
  105. 4:03you need to set the source instance
  106. 4:05which is equal to the listener and then
  107. 4:07the wire Target instance that's going to
  108. 4:09be equal to the audio device output so
  109. 4:12now with this ad listener script if I do
  110. 4:15a play test we are able to actually hear
  111. 4:18the
  112. 4:23audio so now this is a basic setup for
  113. 4:26the audio API so now let's move to the
  114. 4:29audio analyz with the spectrogram right
  115. 4:31here and this time I'm going to
  116. 4:32duplicate the emitter part and just name
  117. 4:35this one analyzer part where I'm going
  118. 4:37to insert an audio analyzer which also
  119. 4:40needs to be connected with a wire from
  120. 4:42the audio fader so I need to add another
  121. 4:45wire this one is going to be the fader
  122. 4:48into the analyzer where the source is of
  123. 4:51course the audio fader and the target is
  124. 4:53the audio analyzer and now this part
  125. 4:56what it's going to do it's going to
  126. 4:58analyze the audio track but F I'm going
  127. 5:01to move into the documentation before I
  128. 5:03actually get into the scripting so the
  129. 5:05audio analyzer is going to have the peak
  130. 5:08level and the RMS level properties which
  131. 5:11are set to read only but these two these
  132. 5:14aren't really what we care about it's
  133. 5:16mostly the methods and the get Spectrum
  134. 5:19method to be exact and now what this
  135. 5:21method does it Returns the frequency
  136. 5:23spectrum of the last audio buffer as an
  137. 5:25array of numbers and the elements of the
  138. 5:27array are rootman square volume levels
  139. 5:30evenly space from 0 to 24,000 HZ and
  140. 5:33what this exactly means is that it's
  141. 5:35going to return a table where each
  142. 5:37element is a volume level that's inside
  143. 5:40of this range and how can you basically
  144. 5:43just translate that into scripting so
  145. 5:46you see I'm just going to duplicate the
  146. 5:48spectrogram and just move this one into
  147. 5:51the audio analyzer folder and now the
  148. 5:54number of parts in the spectrogram
  149. 5:55doesn't really matter what matters is
  150. 5:58going to be the orientation
  151. 6:00where you want to keep the same
  152. 6:01orientation for all of the parts on the
  153. 6:03spectogram and that's because when you
  154. 6:05change it size we basically just want
  155. 6:07them going like this instead of if let's
  156. 6:09say this one was rotated instead it
  157. 6:12would go like this and just to presented
  158. 6:15on the previous
  159. 6:17example I'm going to just comment this
  160. 6:19line so I don't hear the audio double
  161. 6:21from both of the examples at once so if
  162. 6:24I do a play test you can see the
  163. 6:26analyzer basically working correctly
  164. 6:28right but if I duplicate the number of
  165. 6:31these
  166. 6:32parts it's also going to work fine
  167. 6:35except it's going to have a wider
  168. 6:37variety of range so it's going to be a
  169. 6:39bit more accurate so I'm just going to
  170. 6:41uncommon this line and let's get into
  171. 6:44scripting so first you just want to get
  172. 6:46references to the audio analyzer and the
  173. 6:49spectrogram
  174. 6:50folder like this so here we get the
  175. 6:53spectogram and the audio analyzer and
  176. 6:55then we want to get a local function
  177. 6:57that's going to be called setup where
  178. 6:59this this function is going to be called
  179. 7:01on a local variable and that's because
  180. 7:03we want to return basically a table of
  181. 7:06all of these parts so each of the local
  182. 7:09Parts is equal to the spectogram get
  183. 7:11children but there is two things that we
  184. 7:12need to actually do with this one is
  185. 7:14that since this is a local script we
  186. 7:17need to wait for all of these to
  187. 7:18actually load on the client so we just
  188. 7:21do a repeat Loop until this spectogram
  189. 7:23get children is more or equal to the
  190. 7:26number of the children that we currently
  191. 7:28have in my case is 27 so I'm just going
  192. 7:32to do a Tas bit until everyone is loaded
  193. 7:35then we want to return the parts but
  194. 7:37first what we want to do is actually
  195. 7:38sort them by position since if this
  196. 7:40isn't sorted it's basically just going
  197. 7:42to make it so Random volume ranges are
  198. 7:45going to be assigned to random parts so
  199. 7:47we want to do table at sort and you can
  200. 7:50see that there is a com which is a
  201. 7:52comparison cbak so you want to sort the
  202. 7:55parts table and then give it a function
  203. 7:58where a is going to be the this index
  204. 8:00and B is going to be the next index that
  205. 8:03we want the function to compare and this
  206. 8:05one is going to basically just do a
  207. 8:07return on the red axis which is going to
  208. 8:09be the red one you can see from this box
  209. 8:11right here so you just want to do a.
  210. 8:15position X and I want to check if this
  211. 8:18one is more than b. position. X and now
  212. 8:22since I don't really have the time for
  213. 8:24this right now I'm going to get two
  214. 8:26functions from the audio API place and I
  215. 8:29will just explain them so now one
  216. 8:30function is going to be deler which is a
  217. 8:33linear interpolation and another one
  218. 8:36which is a main function in the script
  219. 8:38is going to be the get mapping beIN and
  220. 8:40now this one requires a ban count where
  221. 8:43this ban count is going to be the parts
  222. 8:44from the setup and then it says its own
  223. 8:47be variable which is the audio range
  224. 8:50returned by the get spec through method
  225. 8:52then it basically just checks if the
  226. 8:53Spectrum was empty and if so it's
  227. 8:56basically just going to return a table
  228. 8:57containing only zeros but then there is
  229. 9:00a result which does basically just a lot
  230. 9:03of math where it gets the power value
  231. 9:06the lower the upper and the fluctuate
  232. 9:08then says the result for the index and
  233. 9:11what all of this map is basically just
  234. 9:13used for this is for calculating the
  235. 9:15size from the Spectrum range to later
  236. 9:18translated into the parts and it's done
  237. 9:21in a y
  238. 9:23Loop where again we do local beans is
  239. 9:26equal to the get mapping beans from the
  240. 9:28length of of the parts and that's also
  241. 9:31why I said that the number of these
  242. 9:33parts right here doesn't really matter
  243. 9:35because this function is just going to
  244. 9:37space everything out separately then we
  245. 9:39need to do a for Loop to set every value
  246. 9:42from The Returned result to the
  247. 9:52parts where the current part is going to
  248. 9:56be the parts from index since for part
  249. 9:58one which is going to be this part based
  250. 10:00on the Sorting from right here is going
  251. 10:02to have the current size and then as set
  252. 10:05size from the result where in this case
  253. 10:08we only want to change the Y size so
  254. 10:10it's going to go like this so now we
  255. 10:13just want to clamp
  256. 10:14it and I'm just going to format this a
  257. 10:16little bit differently so you want to
  258. 10:18clamp this one from 10 times beans from
  259. 10:22index and we want to clamp it basically
  260. 10:25so it's not going to extend its Grand
  261. 10:27range or the size rather when this size
  262. 10:30is basically just set to 10 so we just
  263. 10:32want to go from zero if it's going to be
  264. 10:35completely silent and then the Z value
  265. 10:37is going to be the current size do Z and
  266. 10:40this should actually just be while TK
  267. 10:42quite do instead of the true so now if I
  268. 10:45just do a play test it's not going to
  269. 10:47work because I messed something up also
  270. 10:50in the meantime when I'm trying to
  271. 10:51figure out what's wrong do you guys know
  272. 10:52that I make ug items you can go check
  273. 10:54them out the link is going to be in the
  274. 10:55description but anyways oh it was
  275. 10:57supposed to be the current part not
  276. 10:59parts so now if I do a play test
  277. 11:02everything should work fine like this
  278. 11:04except it's going from the different
  279. 11:05direction so let me just fix that and it
  280. 11:07should work if I just reverse this right
  281. 11:09here and here it is so yeah I've got a
  282. 11:12working audio visualizer and let's see
  283. 11:14what happens if I just make this one
  284. 11:16like really long and this one is
  285. 11:18actually just going to be
  286. 11:19216 parts and yeah it's actually just
  287. 11:22going to visualize the audio still so
  288. 11:24yeah this is actually pretty cool
  289. 11:26technology but you may also ask about
  290. 11:28the performance right and since this is
  291. 11:31a lot of parts this script is currently
  292. 11:33running at well three almost 4% of
  293. 11:36activity so that's actually a little bit
  294. 11:39so what would happen if we actually made
  295. 11:41it wait let's say1 second and it's still
  296. 11:43going to visualize the audio but this
  297. 11:45time it's going to do it a little bit
  298. 11:47slower and it's going to be the same if
  299. 11:49I make it wait let's say 1 second but
  300. 11:52yeah that's for the audio analyzer
  301. 11:53instance and that's basically going to
  302. 11:55be it for today so go join my Roblox
  303. 11:57group and leave a like and subcribe to
  304. 11:58support the channel and yeah I hope you
  305. 12:00guys enjoyed the video and see you

About this transcript

This page contains the full transcript of Roblox Audio Analyzer Is Really Great... by Paul1Rb, generated from the public captions YouTube serves with the video. The transcript has 2,301 words across 305 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.

What you can do with it

Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.

Free YouTube transcript tool

YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.