Vurv78 / WebAudio

A safe, efficient and powerful replacement for Streamcore that adds playing & manipulating URL streams through IGmodAudioChannel/BASS
https://steamcommunity.com/sharedfiles/filedetails/?id=2466875474
MIT License
18 stars 4 forks source link

Unable to read webaudio from tables and arrays #55

Open EnigmaThe opened 2 years ago

EnigmaThe commented 2 years ago

Describe the bug Unable to read webaudio from tables and arrays. Attempting to read from a table results in

To Reproduce Steps to reproduce the behavior:

  1. Join local server
  2. Run the following in an E2

`@name webaudio test @persist Audio:table

if(first()){ local Stream = webAudio("https://cdn.discordapp.com/attachments/270015260264497154/984533408489295872/sgc_panic_alarm.mp3") Audio:pushWebaudio(Stream) Stream:play() timer("test",550) } if(clk("test")){ print("Table Size: "+Audio:count()) print("WA Destroyed?: " + Audio[1,webaudio]:destroy()) } `

  1. See error (WA Destroyed line will print a 0)
  2. Replace 'table' in the persistent variables with 'array' and upload to E2
  3. See error ("lua/entities/gmod_wire_expression2/core/custom/webaudio.lua:383: attempt to index local 'this' (a nil value)")

Expected behavior the "Table Size" line should print a 1 to indicate that the stream has been stored in the table, and "WA Destroyed?" line should print also print a 1 to indicate that the WA has been destroyeed.

Desktop (please complete the following information):