Kruiser8 / Kruiz-Control

Kruiz Control enables a pseudo code approach to manage and automatically handle Twitch Channel Points, Twitch Chat, OBS or SLOBS, and StreamElements or Streamlabs alerts.
Other
233 stars 32 forks source link

Issue with sound sources #27

Closed alkaris2 closed 3 years ago

alkaris2 commented 3 years ago

I was setting up some channel point redemptions to play sounds, and I'm running into an issue with 2 channel point redemption for playing sounds. I've been able to add 2 other sounds no problem, but the issue might be due to file format or something, because this is clearly not reading the file format that it's capable of reading, and as I read MP3, WAV and OGG supported formats yes?

Log:

04:44:37.064: obs-browser: Uncaught (in promise) ReferenceError: SockJS is not defined (source: file:///home/alkaris/Kruiz-Control/js/slobs/slobs-websocket.js:10)
04:44:37.078: [obs-websocket] new client connection from [::1]:40292
04:44:37.085: obs-browser: Error reading the triggers/triggers.txt file! Please open the html in Microsoft Edge or your broadcasting software. (source: file:///home/alkaris/Kruiz-Control/js/utils/utils.js:61)
04:44:37.099: obs-browser: Uncaught [object Object] (source: https://code.jquery.com/jquery-3.4.1.min.js:2)
04:44:37.955: obs-browser: Error connecting to streamlabs socket: Incorrect token or connection error (source: file:///home/alkaris/Kruiz-Control/js/streamlabs/streamlabs-socket.js:17)
04:44:38.004: obs-browser: Invalid Password or Permission Scopes (channel:read:redemptions, user:read:email) (source: https://cdn.jsdelivr.net/npm/comfy.js@latest/dist/comfy.min.js:1)
04:44:49.243: obs-browser: Uncaught (in promise) NotSupportedError: Failed to load because no supported source was found. (source: file:///home/alkaris/Kruiz-Control/index.html:0)

triggers.txt

OnChannelPoint Hydration
Play 45 nowait water_splash01.mp3

OnChannelPoint Pop
Play 75 nowait pop.ogg

OnChannelPoint "Just A Box"
Play 75 just_a_box.wav

OnChannelPoint "Nice Shot"
Play 45 nice_shot.wav

SO the 2 sounds that I've been able to add already that DO work play fine, one of them is MP3 and the other is OGG, and the other 2 sounds I'm trying to get to work is WAV format, it's just a standard 16-bit PCM WAV format, and it fails to load as the error indicates that there's no supported source found.

Also can't help notice the other errors that show when its reading the triggers.txt file, the file itself appears fine, it follows the documentation examples clearly, but thinks there's an issue with the file when there's not. Also probably be a good idea to have the script skip over trying to use non-configured sockets with StreamLabs there, I use StreamElements, and that the only one I've configured this with, so I shouldn't be seeing errors relating to StreamLabs.

I did make sure that encasing Channel Point names in Double Quotations, so I don't see why it can't play these 2 WAV files. I can preview them on my system and they work fine I can play them in any audio player/editor just fine.

denilson-melo commented 3 years ago

Have you tried playing the sound in a browser? Simply drag the audio file to a browser window and see if it plays correctly

If it works correctly might be an issue with the obs browser. If you could share the files I could test them on my end for you.

Kruiser8 commented 3 years ago

MP3, WAV and OGG supported formats yes?

Should be the case. It's just using the browser so Kruiz Control doesn't have a lot of control over it.

Error reading the triggers/triggers.txt file

That means you have triggers.txt in the fileTriggers.txt file. It doesn't need to be there unless you also have a triggers.txt file in your triggers folder.

Also probably be a good idea to have the script skip over trying to use non-configured sockets with StreamLabs there

That's not a bad idea, but it's also not a high priority. Not as easy to figure out.

Uncaught (in promise) NotSupportedError: Failed to load because no supported source was found.

Hm, as denilson-melo points out, it might be that the browser can't play it, in which case KC won't be able to.

alkaris2 commented 3 years ago

The audio files play fine in the browser, as expected, tested in both Chromium and Firefox.

Here are the two audio files that didn't work if you want to test them. I did try converting to other formats as well such as MP3 and OGG. https://www.dropbox.com/sh/gp56kggq5fhoq0p/AACF0IMSd0d0cJySp4eZJFDMa?dl=0

Not too sure if it could be OBS Browser issue, because if the first 2 audio files work, the others should work the same as well. But that doesn't appear the case here with this issue.

Kruiser8 commented 3 years ago

The reason the two wav files don't work is because you're missing the <wait/nowait> parameter on those two Play lines.

alkaris2 commented 3 years ago

oh... thats makes sense, DUH! WHY didn't I notice that! xD