There’s no api to grab hold of the system audio and listen in so you can process the audio or record it. Accessing the system audio on Macs can be a pain in the butt if you want to do it by hand. It was time to see what we could scrap together. So, we are at a point where we’ve realized that we have a prototype that needs to be reverse engineered using swift and an assortment of languages that have the letter “c” in it. The open source project can be found here. If anybody is curious, we used an open source Electron audio visualizer code to produce the spectrum and then put it on the touch bar from there. This would decrease the efficiency of the app overall.Īlthough using Electron wasn’t going to be feasible to create full the app we wanted, it still made a fantastic prototype that didn’t take too long to put together. Rather, we would have had to send the images we were creating to BTT in base64. Electron is not natively compatible with Better Touch Tool.Īs far as I know, we wouldn’t be able to make a native integration with Better Touch Tool. It would do this 30 times a second! The cpu usage would sit around 100% and sometimes get up to 120%. The process had to be done by having the app read the audio buffer, process the audio with calculations, draw the rectangular bars on a canvas, then take a picture of the canvas, transform the picture from a png to base64, then display the image on the touch bar. Using Javascript and Electron to produce an audio visualizer is pretty inefficient. There is open source code to force an app’s touch bar configuration open, but it was not compatible with Electron. I was successfully able to put the window in front, only to be disappointed that you still had to click the window to see the visualizer. I tried to fix this by forcing the window to always be in front. There was no way to keep the visualizer open when you clicked off the app’s window. This could be solved by using the system audio, similarly to what we accomplished, but there were other issues. In order to use the audio visualizer, you needed to have the mp3 file downloaded to load into the app. Mainly: The audio was only accessible by playing the song through the app. However, Electron left us with some problems that needed to be sorted out. Electron is a great tool for devs that know Javascript – you can actually build full fledged apps using just Javascript! And I have enough working knowledge of Javascript to understand what was going on inside the app, win-win. Our prototype was designed and created using Electron.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |