Trying to develop a Custom Widget to play custom sounds

Hi everyone, I’ve been trying to develop a custom widget, or widgets, to allow the dynamic or static configuration and playing of custom sounds (Mp3 files). I know that some of this can get into a bit of a copyright issue so I’ve been trying to use ‘Royalty free’, public domain clips so far. I have been able to, in the HTML for a custom widget, point to a URL for an MP3 and have that play. I have not had much success in embedding, or inserting via a Prop, a sound stream that I converted from a file to a 64bit string though. Any suggestions, thoughts, solutions.

Here’s the JSON for what I have been working on so far
customWidget-New Sound - mp3 - player.json (170.7 KB)

Once I get past the part where I can specify actual 64-bit streams I am pretty sure I can add, via js, to play from a trigger or in the widget itself.

Thanks,

@wkurth4008

2 Likes

I don’t have a direct answer, but was working on something similar and found useful documentation on audio in html here: HTML DOM Audio Object

1 Like

@wkurth4008 So this is a bit wild, but I was determined.

There is a way to make this work but it is definitely a hack. In the meantime, I’ve submitted a ticket to see what is going on with the following: “We can play mp3s via a URL and your chrome browser has no problem playing the base64 encoded mp3. The custom widget, however, will not play the base64 encoded mp3.”

Now on to the workaround. Since we can play from links, I took the approach of trying to host the mp3 file in Tulip. Soon we’ll be able to upload files but for now we can only upload videos, images, and pdfs. So let’s download the mp3 as an mp4 and upload it.

image

Now we have the problem that the actual s3 storage is secured so that the custom widget cannot see it. Plugging that new URL into your browser will give you this:

But if we inspect the element in the Tulip app we can see the signed link and use that instead. I’m not sure exactly how this all works, but it works.

image

Now, if you use this link in your widget you have a Tulip-hosted audio file that can play in your custom widget

image

1 Like

Thanks Mark,

ya, I thought about uploading the files into a ‘Tulip hosted’ domain somewhere. Security wasn’t something I much considered but it seems like a bit of a glitch that somehow works anyway.

I guess, my main concern, about hosting sound, or music, files on Tulip hosted domains (AWS, Azure, GC, whatever) was something I personally had run into a bit of an issue with. A lot of, or most, of the mp3 files out there are copyright protected. I tried to find some ‘public domain’ ones and was able to find some academic and other sites that directed me to public domain, or ‘Creative Commons’ files. I just wonder what the legal/copyright issues would be if Tulip hosts copyrighted files on their cloud hosts? Especially if those sounds/music is used in some commercial, or money making, app?? I ran into this issue myself when I used a Rolling Stones song on a YouTube video I had posted. I had just used the song as an intro to a short comedy bit I had done, which I recorded and posted on youtube (warning…my comedy act is by no means ‘clean’ and could be considered rather vulgar, although not as vulgar as other comics I’ve seen there) I noticed, a few weeks ago on my youtube channel that it had a ‘restriction’ column marked as ‘copyright complaint’. I don’t steal other comics materials so I wondered what that was. When I clicked on it it came up with something to the effect that 'Polydor records, representing the Rolling Stones and their song ‘Can’t you hear me knockin’, the 1977 remix, was their property and any money, or monetization, I received from that clip, was theirs. I’d like to think that one of the members of the band took notice but I imagine it was some bot, which I understand youtube regularly runs, that found my use of that song. I clipped the song portion out from the beginning of the video and a few hours later the complaint dissappeared.

Just saying, that there may be other copyright/legal/fair use issues involving with people uploading and using sounds, songs, or music that is then incorporated into their apps.

Honestly, that’s kind of why I was trying to get it to run with the 64-bit translation. Then, at least it would be embedded in the app itself and maybe not so much a copyright/distribution issue??

Anyway, I look forward to seeing how this develops. I know there are some custom sounds that people would probably like to use in their apps. Again, copyrighted, but I can imagine that if they used a Tulip App to do self-ordering at a McDonald’s they might want it to say something like ‘Have it your way’, or ‘would you like fries with that’. Other MFg operations I’m sure would have their own use cases.

Thanks,

@wkurth4008

Sound effect licensing and royalties and licensing is a rat’s nest of rules and best practices. Here is one explainer that covers a lot of software-building questions. Scroll down and look under “Projects Allowed” and “Projects Requiring Additional Licensing”

I was (of course) trying to trigger a sound based off of an MQTT event :slight_smile: I ran into a bunch of browser blocking to stop those super annoying ads that used to play sounds right when you navigated to the page! (I appreciate this, but it makes what I wanted to do ?impossible?) The browser does let you play sounds based off of button pushing events (since the user is triggering it) anyways just my 2cents on my experimentation.