 Yeah, my computer literally waited until the show started to then just go to all black screens for about 30 seconds It's this weird state it gets into Hey, all right weird weird state my computer just went into but I think we're live. Thank you DJ Devon 3 My computer waited until the broadcast started to then just go to all black screens really weird, but I think we're back Maybe better than ever. I don't know we'll find out Bandwidth and all that stuff. I don't think it's the issue today again I'm probably cursing myself by saying that but And it's looking good In fact, not bad four megabits a second up. It's saying right now. It's decent All right. Hey way whoa, let's get this thing going after that weird start It's me John Park and you and I are here together for John Park's workshop we're right here together in the shop and We got some fun stuff to look at today and to talk about so thank you for joining me It's a real pleasure to be able to have you come in here and hang out Charles Burniford what happened you asked? Yeah, the show was just beginning and all screens go black fans spin up Fans go quiet. I hit the little weird I don't think I'm actually a power button button on the back of the Mac. This is iMac Pro 20 seconds later. Everything's back as if nothing happened Hmm, but I did have to kick the little start the broadcast button again. So it did something so weird But hey, let's let's get this thing started So first of all, I'd love for you to get a little discount if you head on over to Adafruit comm today and buy some stuff And this is your coupon code. So sound scape The coupon code sound scape will get you 10% off in the store today. Just head on over to this place right here Adafruit comm you can head to the Little hamburger there and go to new products if you want to see what's the new stuff some new things in the store Including this ESP 32 s2 reverse TFT feather. I haven't gotten one of those yet. It's brand spanking new looks cool though Gives you all the space and the feather stuff is on the underbelly of it. I think weird, huh? And some other good stuff. So if you want to go buy some things and get yourself a discount Then just type in sound scape today. That's the coupon code and that's gonna be good Until around midnight East Coast time. I think that's how that works probably it What else is happening I've got a Show on Tuesdays. It's that one right there JP's product pick of the week and Oops, hey, that's weird Where'd the logo go? Oh, you know what when that happens? I Have that one asset sitting on a drive that I think You can't find that didn't come back up Uh Jiggle that let's kick this drive back on That's funny. I thought I had taken all assets off of that drive. It's an array actually a rate array Uh, I'm just it's because I was noticing that there's a little Logo that sits right there. You can see it's just a little black box um Probably even if that drive comes up, this is gonna need to Be refreshed to to be told to go find it. I'll do that. Sure. I like to Live dangerously, let's see Logo small let's replace the media browse disk Let's go to the promise array No, that's not the small version of it. All right, I think we'll live without it today. I don't want to search for that anymore Uh, let's see. So oh it came back. Okay. Good. Yeah There it is. Yeah, it's back. I didn't even locate it. It located it itself But the logo next to it This was the missing one Boop, it's back and this one here Uh, it's because I was just starting to talk about JP's product pick of the week happens on tuesdays pick a new product Sometimes an older product and put it through its paces a little bit give you a big huge discount We had a 50 off discount on this week's product pick. That's it right now And here's a little one minute recap The iot button bff This little bff it attaches to the back of a cutie pie And it basically adds two things to your cutie pie a nice big 12 millimeter tactile momentary button And a neopixel those are on pins a2 and a3 respectively. I've got my bff Got some socket headers. Here's a cutie pie. All you do is plug those in like that And off you go. I'm using whipper snapper with this. I have this paired with my wi-fi Router when I press a button I'm going to get that iot button bff indicator on my iot page to blink I have this color widget. Oh and and pick a different color. Let's go to green Uh hit save there and now that updates. That's my product pick of the week this week It is the iot button bff with neopixel for cutie pie and jow board Yes indeed it is. Uh, hope you got some of those and can do some cool projects with them. They're also really great fidget toys 12 millimeter flat tactile button great fidget Uh So who am I talking to you're wondering? Hey, if you're somewhere where you're not seeing much in the chat then you might want to head over to our discord It's at adafru.it slash discord. Uh, it's got all kinds of great stuff going on in it There are many different channels in our discord, but if you find a live broadcast chat channel, that's the one That's going on right here and the um Salty comments there but the one that cracked me up is this So we'll be we'll be doing some stuff with the uh with the See and say today and uh Who did this this was? dj7 3 it's the jp and say That's hilarious. I love that. Look we got a whole cast of characters there whole cast of adafruit characters. They're very very well done Now I want to now I want to redo the sound files with stuff from from all these different adafruit people All these adafruit personalities saying stuff. That would be a lot of fun uh Thanks for doing that. It's very funny So, uh, you can head over to that. Also, I'm keeping an eye on our youtube. Um So hello to quinman 16 gary t chiles berniford Uh, davo desa johnny burdall. Hello and welcome. Thanks for stopping by in the youtube chat um And let's see what's next so This is a good time to do a Little circuit python parsek All right, let me grab that window right there What I wanted to talk about today in the circuit python parsek is how you can filter items in lists So if you look in my little code window here, the first thing I have is just I did a file directory List, uh of what is in this directory that's on my feather board sitting right here So volume circuit pi my files to sort directory. Here's what's in it. I have a bunch of BMP and jpeg files and they have some different names on them They have things like some of them end in final some have different version numbers and like I said, there's a mix of jpegs and BMP files there. So if I go ahead and reload The code here what I'm doing is saying Sometimes you have a list of files and maybe you don't know what their names are going to be going into it But you just want to be able to sort of uh intelligently sort through them and filter for certain tokens certain pieces of the name So in this example, what I'm doing is I'm saying just show me things that are jpeg files And just the ones that have that underscore final So maybe we have a bunch of files on here But we're only going to do things with the ones that are named final and that happened to be jpeg Now I can go and change this here. I'm going to say just show me BMP files Uh, and I'll resave that and you can see here. I'm getting actually two lists One is just list out all the BMP files So it has filtered out all the ones ending in dot jpeg And then I have you know what give me the ones that actually have that word final in them And this is this list here at the bottom I could change that and say I only want to see v ones or v twos or any name token So the way this works is I'm importing os and that allows me to do some of these sorting and listing of directories So I build this list called my files and in it is anything that meets this search First of all, we list the directory then we make all the names lowercase make life easier on us And then we're doing our first filter here Which is if the file name ends with and then it has to be dot and my suffix in this case BMP And it doesn't start with a dot because sometimes we get these dirty files on our file systems these dot files So I don't want any of those so that's what prints my first list out Then I can take that list and refine it. I can filter it even further So then I take that list and I say for each of the items in that my files list Go ahead and tell me any of them that find so file name dot find this String right here underscore final If it includes that then I add that to a new list and then I'm printing each of those items out And then we can go and do further things like display all the jpegs display all the bmp's do stuff with wave files Only things with a certain version number final in them And so that is how you can do list filtering in circuit python and that is your circuit python parsec For you And One of the reasons that I was doing some stuff like that is because of today's Project the continuation of this see-and-say project where I have Wave files and I wanted to be able to Order them so I wanted to be able to filter only the ones that actually are a proper wave file Since you can get corrupt stuff there these dot files not really corrupt But dirty stuff you don't want to grab excess stuff crafty things I just want to grab the proper files And I also wanted to list them alphabetically so that I can just name them zero one And then a name zero two and then a name and I know that I can assign them to different positions on the see-and-say So that All that filtering and sifting of file names really easy to do In circuit python you can do that on your computer as well using python. So it's a it's a sort of Really helpful set of Commands to have at your disposal when you're dealing with files with little asset files in this case All right Let's see. Let me see what's going on in the chat Other than some gar fields Oh, gosh I don't know what's happening there. There's a Lars with a terrifying barbed wire covered baseball bat Uh Kiyoshi said they tried to order the reverse tft feather last night. It went immediately out of stock Yeah, I think there was there was just like 25 of them in stock last night, but I see now Uh, if you head back over here, it looks like the Stock got replenished. So Uh, if I click on that one There are 87 of them in stock. I'm not sure why there were there were a limited number from last night I must have been what was ready and and more came in Uh came off of the assembly line today Uh, right. So What else is happening? Let's talk about the cnsa project. So let me jump over to this View here. I've you can see I've buttoned it all up. I actually finished the build Uh, put it inside of its little case there And so just if you're wondering what this project is if you haven't seen the evolution of this I took a this is a modern Retro styled version of the classic fisher price toy the cnsa This I have do I have the other the other one's not here I got two two of them. This is the kind of cooler more modern or more retro style one The way these normally work is you move that arrow or just leave it where it is but set it in front of Let's say the dog you pull the cord and release it and as you pull it all the way to his extent It plays a sound effect and in this case it plays these animal sounds so Lamar said, hey, could you do a version of this that you replace the guts so that you can put your own sounds on there also drop the volume a bit because it's really loud and Change the sounds to urban sounds things you'd hear in a city especially because uh phil and lamours kid is going to be a city kid so Maybe some more appropriate sounds dump trucks and things like that Ambulances you know so what I did was I Pulled the guts I I found out that I could reuse the button There's a circular button pad just like a game controller pad basically contacts that get bridged by little carbon pill type of rubber dome switches And then I'm just reusing that part just that ring to then send those button presses to a kb2040 Which can then save can then play wave files over A little i2s amplifier and uh the thing I actually I think I I'm happiest about in this is one of the first times I've just reused the existing double a Battery box in here and put a little boost converter a little mini boost that takes the Roughly three volts you get or less out of the two double a's turns it into five volts so It has only one external modification visible, which I'll show you in a second but I decided to stick it all the way back up in the packaging and Take it out so you can see that this thing is actually Not that I'm encouraging this thing But if you want to get one of these and put it back on the store shelves with your own nefarious Audio you probably could get away with it, but I didn't tell you to do that So, uh, let's let's head over and take a look and a listen to The modified cncel uh cn say and then I will pull it apart so you can See what what the circuit is that I came up with I had last week I had it on a breadboard now. I have a proper little Contained circuit buttoned up in there. Uh, so I don't think it's going to work right now because I have it switched off Yeah, so Just to Give you a sort of extra level of control over battery saving I put a switch on it One thing I haven't done yet in code that I'd like to is add some deep sleep so that even if you don't turn the switch off It will preserve battery So You can see these have these cool little instead of all of those twist ties or zip ties These have these cool little keyed connectors little plastic key connectors that go into little keyhole Plastic that's molded into the toy itself. So that twist locks those for Shipping and and keeping it neat in the store You'll see I only use three of those because the fourth one has my switch on it So there you can see my little My one external modification that hole existed. I just boarded out a little tiny bit to be able to fit Uh, fit a switch there. So if I turn that on Uh, you can I'll probably since I've made it a little quieter I'm gonna hold this up to my to my lapel mic so you can hear it. Uh, let's let's start with my favorite one here All right, so So I don't put my head in the in the view of that. Sorry, I'm gonna Pull my lav mic out and I'll show you this again So you can set it to whichever one you want. Obviously my icons don't match up yet I'm still gonna uh, still have to create Uh, a new template a new sticker for this Crosswalk there Uh, so I'll put this back up here. Let's uh, take a look and actually I can uh, you'll you'll be able to hear things a little better when I remove this mechanism just because it the The spinning makes a lot of noise. Uh, and it's actually not necessary other than the fact that this has a Essentially a rotating plastic nub That lines up with one of the 12 buttons that are on the button pad that's inside of there When this gets pulled and reaches the end. In fact, I'll I'll just pull it and you'll hear it this time It's a bus air brake. Uh, yeah, actually, let me let me show you these so The uh, the button gets pressed when this gets pulled all the way to his extent You just don't you don't have to let it go if you don't want to hear hear this thing spinning So there's a bike messenger There's an ice cream truck so Uh seems to work Well, it's actually fairly uh A fairly solid build. I don't think you'd want to bash someone over the head with it Uh, which is the sort of thing kids do when they get a thing with a handle. I know from experience, uh, but um I think it's actually fairly, uh Robust, uh, you could probably add a little extra foam or something to to keep it even more robust So, uh, let me show you how uh, how this all works. So I'll pull apart Uh, first of all, you'll see we've got Our battery box there. Uh, this is Let me zoom in a little bit. This is unperturbed. So this is pretty much stock Um, these are even these weird cheap light batteries that it ships with and and you probably want to switch these out for some good Alkalines, uh, or you could probably use nycads with it. That would that would be fine too Um, and I guess I'll I can leave that off. This will this will work fine. So then This is how the original disassembly and assembly went. There's uh, something like eight screws normal phillips screws and Nothing tricky. Nothing hidden under a sticker anything like that. Let me pop those out so those are the two, uh, most finicky ones because they're recessed a little bit and then there's two four Five so seven screws total You know what I didn't test today is is the camera switch are working Yeah, it is. All right, it's only working in one direction Whoops. All right, let me put it back to the What happened? That's the view I want So I was I've mentioned this before but one of the things that often happens with these types of projects is that I put a lipo battery and then I need a Charging circuit on there with a feather or something. It's built in But those are a little bigger and then you need a usb port to be able to access that It would be nice to have a usb port on this one because then you could go in and reprogram it But for now I'm keeping it as sealed up as possible So that's something I may consider is doing one of our little flat ribbon cables And having it just like peeking out from the battery box or something so you can put put the usb connector on there and program it So what I learned about this is the There is a toothed Sort of rack gear That rotates Right here and it actually lives when it's in this resting position underneath The board that we want to avoid pulling out violently. So what you do is when you pull this back It places that That arm In a safe place to open it up and I'll show you what I mean a little better when I So you can see this is my New electronics. This is what was Existing here. This is the existing speaker. That's my added switch this Gear right here that sits right underneath Here so there was just just the right clearance there Sort of it's it sets right in above that battery box protrusion So I don't want to lift this up with that in place or it'll it'll lift my board up, which could be bad This is just double stick foam taped To the back of the battery box section there. So by pulling that you just get that out of the way and that's Same in reverse when i'm putting it back together But you can see on this one. This is actually easier to see than that previous version Here's the ring That is in one of the 12 positions for the 12 Animal sounds and when this gets pressed Watch that center Lift up. That's it right there. That's that's what presses a button and you can see that goes to a different position when it gets Let go. There's a little uh sort of flywheel that Sends that around to new positions And that's coupled to This so you can place it where you want so I can just move that to a position Only in one direction by the way if you go the opposite direction you're kind of Fighting the spring and it returns so only clockwise, but if you set that somewhere Uh, and then pull the string When it reaches the end of that pull that's when it lifts this upward against that little spring there And that presses one of these 12 buttons so We can zoom in a little bit here And You should be able to hear them now a little better Motorcycle going by so I'm going to tune the levels a little bit just I think in my Audio editing app just to get them to the same you could also In code have a different mixer volume associated with the different sounds, but I think it's it's just better practice to have them At matching levels sort of normalized as the the wave files themselves I'll play some more of these I uh set the volume really low because there were two I think of these files the loudest files on here I was playing at full volume and that was causing distortion like really bad distortion something horrible was happening So I dropped the volume the mixer volume in the in circuit python the mixer volume down to 0.2 Um, which is why some of these are a little too quiet. So I'll I'll fix those up Normalize those against each other or equalize them against each other pedestrian crossing thing And I set it up so you can play Sound after sound after a sound and it just stops the one and starts the next one This mic closer to that for a second Angry traffic train crossing Everyone please leave the train And I can just turn it off with my little on-off switch So I went over the circuit last time, but I'll uh, just give the broad strokes of it. So I zoom in on here. You can see uh, this Is a set of 12 Of these little copper contacts that are near each other and get The circuit closed by a rubber dome Little carbon pill Conductive carbon pill when those get pressed you can see I have Some of this wire wrap wire get something to point with here There's one on a test point per Uh Button and that all runs down here and going to 12 IO pins on the uh on the kb2040 So essentially pins I think GPIO 2 through 9 10 and then I think it's uh Serial clock and Mi of the spi Then these three pins are being used uh for communicating with the Amplifier so this is the digital i2s audio Going data clock and latch or word select Data clock and word select. I think it is to the i2s audio I'm reusing the the speaker that came in this and this is a great if you can get away with this in toys that you're You're re repurposing Do it because they're they're The the speaker is designed to use the enclosure as a sound board usually so um A lot of the amplification of the of the speaker's sound Is based on it being clamped down really nice and tight with this plastic ring all sort of custom Designed uh so that that whole thing acts as a Um as a sound board basically like the back of a piano uh, so luckily this uh Speaker worked well with this amp so you can see I just have it soldered Into my amplifier there rather than using the terminal blocks which adds some height. I didn't think I had that clearance there um, I think this red ring on the speaker is close to the limits of Of the height that you have One clue that I have that that's at the limit of it because it's a hard thing to measure inside of there um Is that you see this little dip that's in the plastic ring there Uh, you can see there's a little dip there. I think that matches up with this little Nub here. It's like a little plastic It's almost like registration nub So that may be so that this is actually in contact With the with the front here. I think all of this contacts this so this whole front acts as a sound board Uh, and then you can see there's also like a little grill There to let the the sound through So you don't want to mess with all that stuff. It's it's not going to work as well I think versus just using what was designed originally. It's a really well designed um Like I said, these are these little key holes for Their only purpose is the keeping them in the box nicely and one of them I Widened a little bit with a reamer and then put my my on-off switch through there Uh, and then battery box you can see here I'm gonna just change the focus a little bit So battery box had uh, the two Leads coming off of it, which I've run up to ground on my perma proto board and then the uh positive voltage from that goes into the uh voltage input Of the boost the little mini boost which takes that and and brings it up to five volts Uh, and then I have a little Shot key diode here, which is the idea behind that is to prevent disaster if you do end up Leaving the power boost running while you plug it into usb because you're programming it since We're we're using the five volt off the usb The raw jumper is flipped so that we can get get the five volt right off of there Um, and that's what's powering it. So I didn't want to cause any problems So I think this this diode is uh, at least a bit of an insurance policy against having Two voltage Two voltages collide coming from usb and battery through the boost The power switch by the way What that's doing is there's an enable Pin on the the little mini boost there Uh, so that allows me to essentially cut power coming off of this So I just ground that so the the switch just goes from this enable pin to ground um And that will enable or disable the mini boost and that means it either is or isn't sending the five volts out That's running basically everything else Um, one of the other reasons that the five volts are good is the i2s amplifier would much prefer five volts to three Um, so it's it's nice to feed it the actual five volts rather than the three Um gives it more oomph so uh, the other thing I don't Have going here, uh, which I had been using before but I don't think I need is you can set Let me zoom Can I zoom in any further? No, but I can sharpen that focus just a little bit You can put a resistor From the gain. There's a little gain pin on the i2s Amplifier and you can pick different resistor values and run them either to ground or to voltage in And it's just a sort of on boot chip select for how much additional gain This is going to amplify with so I have it at the default You can go higher you can go lower But I found that it's fine in the default in this case since I can use the uh, the mixer inside of circuit python to, um Adjust the volume of it. So Uh, so let's go ahead and plug that in and I'll just show you what the code is looking like now And also show you what happens if we mess around with that gain Um, also questions coming in let me let me let me look at the the discord here for a second first. Um Kiyoshi says is there an advantage or disadvantage to using the enable on the boost versus cutting power to the boost so um One advantage is that you don't need as heavy gauge of a switch So if you are just trying to Uh interrupt the current flowing from the batteries to other stuff Um tiny tiny little switches might not cut it. They might get a little warm from that Or not like like having that job. So, uh, you can this is more of something i'm used to from from using larger Uh current projects than this one, but if there's an enable pin, I like to use it because it is a Very low Current draw type of switch that Means you don't have to try to put like a big bulky switch in between a power source and the thing that you're running So you can usually use there's a There's an enable pin on your microcontroller often as well or the run pin on the pico We have enable pins on on many of our microcontrollers. Again, if those get grounded then That stops drawing power, but if you have other stuff in the circuit, that's not not a guarantee depending on where it is So, uh, hope that hopefully that answers that question Uh, let me throw this Down cam view here And a me cam there, why is that not switching? Oh, that's why Uh Yeah, let me put this here Actually, you know, I'll switch to this this mode Uh, let's see other questions. Yeah, you could make a custom pcb for this. Um I don't want to recreate this part because it works great and it was actually easy to solder to there's test points on there But this right here could be a custom pcb. Um, I wanted to do this for a learn guy I know actually bill Mentioned this last week too. Why don't you make a custom pcb? Uh, I'm just trying to do a learn guide that's that's easier for someone to Uh, follow if they have some basic soldering skills So you could build this on a breadboard try it out move the breadboard to a perma proto Um, and then I'm not going that one extra step of showing how to um, how to how to make a pcb for it But certainly it would be Uh, more effective efficient cheaper if you were doing this, especially multiples of them to start start considering doing that as a pcb Um I don't know what the quiescent current is for this, uh boost It that's a good question. You might be able to check the datasheet on that. This is the mini boost five volt one amp Uh, let's see other questions Hiding a usb connector. Yeah, I like these, uh We have these little ribbon cable ones Did I move those? I don't think I have one right here Uh, we have These little flat ribbon cables that can be used for hdmi and usb and we have little, um Connectors that go on the ends. So this would probably fit coming out of Uh, one of these little slots here Um It almost is a perfect fit. So you might just need to Shave a little bit off of that Uh, so that might be neat to have that just sort of At the ready and then the connectors that go on them, uh are just little sort of Flippy clip connectors. I forget their names, but you can you can just go click like that and connect to it So if it's something you're not using a lot of That might be a nice way to go versus the typical um Panel mount usb thing, which suddenly that's actually A lot of that'll take up a lot of space, uh in a in a project like this with that big stiff pvc coded Wire to try to fit in there. You might be able to Put one in the foot here, uh and route the route the usb over here. Um, Especially if you one nice thing on the kb2040 is you can use the data plus and data minus pins on here So you don't need to plug an actual usb connector in So you can you can take a panel mount usb connector And uh cable cut one end of it off strip tin solder So at least you're not poking a full-sized usb connector out of this side here Let's see other questions Oh, uh one thing by the way someone said uh ice cream truck complete with doppler effect I got all those sounds off of freesound.org And I will credit all of the the people who created those most of them are creative commons licensed With with attribution. So I'll put all those attributions in The read me file for this or something so that it's all clear where those came from and then I just went and did some Editing of them down to the part I wanted, uh, and I'll still do some editing to normalize the volumes like I said so, um This is off right now. You can see I've while I've got it open. It's really easy to see I've got a little green led when it's on um So I'll turn that off then I'll plug it into usb And most of by the way most of the cable dressing I did with uh capton tape So just to keep things neat And out of the way so I took a bunch of these input Wires and just put them below the level of the usb connector so I could plug that in Um right there So let's uh jump over to Code view of the world Uh-oh, did I just break that? Let's see. I made that window go away. Didn't I hold on let me fix that Sublime text Code window Yeah, it updated. Okay So What's going on here? So I got a note to do at the top here for myself add add sleep. I don't have um Deep sleep yet, but you can do there's a pin uh sort of a pin Alarm mode where I can set. Uh, I believe I can just set any of these 12 pins all of them Basically if any of those get touched then it'll wake up out of deep sleep. So that'll use use less power um Got a bunch of libraries i'm importing here Uh for audio stuff os for some of that file sorting Getting files out of the directory The files are just sitting in a waves directory. I think I put it in um on the kb2040 itself Setting up my buttons. So these are all the pins i'm using Yeah, so it's d2 through d10 most see me. So and zero clock those are the 12 pins that those Uh buttons go to Make those into button using the debouncer button Class make them buttons that I can read easily Here's some of that filtering Reading the directory. So I've set up a list called sounds and then that list gets Filled with anything that meets these criteria. It lives in the waves file Rather the waves folder or directory Ends with dot wave and doesn't start with a dot at the beginning. So that becomes my list um, in fact, if I Let me toggle the terminal in here if I connect and resh Reset the board You'll see when it boots up. It's gonna spit out the list for me there. Hey, that's weird. It missed one Why did it do that? Oh, I think I need a little sleep in there No Hey, let me look and see did I get a corrupted What happened? There's a there's a zero one file on there. I swear. Let's see why it's not showing up Oh Yeah, it's there zero one ice cream Why is it not showing up here? I don't know why that's really bizarre Let's see if it's still there It is I don't know why it's not showing up in that list Let me add a little delay Sometimes when you have usb plugged into a thing that's doing sound stuff Uh, the ripple and circuit python can get a little squirrelly. It's still a little funny to develop on Because of the usb access stuff. So I think that's what's going on here Um, it wasn't happening when I was developing it before so I don't know what to say about that but hopefully there'd be a way to Trouble shoot that so that you can see your full list because that list is a lie. There's a zero one ice cream truck So it is making the list, right? It's just not printing it properly Then uh, in fact, let's let's add something just for fun. I'm going to do print Sounds There so that Right there that shows the true story. There's that zero one ice cream truck. We've Ended up not not working weird Uh, let's see. So then I'm setting up the audio mixer And I've got my bit clock word select and data pins. Those are a one two and three Uh, I have a single voice count because I'm not trying to mix two sounds at once I have a pretty low sample rate, uh, 11 000 And I'm only doing mono. So it's a single channel 16 bits per sample True for samples are signed. Uh, here's the voice volume. So this, uh, if I raise this up We should Let me pick one that was pretty quiet before like the bike bell That's not the bike bell So I'll raise this up all the way to one So you can get it quite a bit louder, but this peaks out and goes crazy with some of those sounds. So For now, let's just leave that At something moderate. Let's see if it here. Let's see if it freaks out with one of the ones that was Not bad. Okay. If it's any lower any higher than this level, then it was really distorting and Causing issues Yes, the microcontroller is doing everything aside from the amplification. So microcontroller is, uh Storing all of the wave files. It is accepting the button presses And then it's triggering audio to play over the Uh i2s Lines which then go to the amplifier and that's that's where that takes over um Here's my little play sound function. So wave file gets opened picks the right one roll binary And then The wave is played through the mixer voice zero Uh, and then here's the main loop. All we do is check for button presses if a button gets pressed then play sound uh play sound takes care of everything it's whatever whatever button got pressed is the Variable that gets passed to it. So button two That went up found the second item in that list and then Opened the wave and played it Yeah buttons are zero indexed and the and the files are indexed with one I decided uh if I gave it much thought it was just because I was thinking in terms of if someone The only thing they wanted to do was drop different wave files on here. They might Be more likely to think in terms of file one through through 12 rather than zero through 11, but uh, yeah, it's it's never going to be perfect. Um Could the i in the ice cream file name get confused by the four i loop? Huh, I don't think so because it wasn't before uh It's a Interesting thought. I don't know. Um, should we try changing it? Let's try it So all I should have to do here is um Let's see. I can probably Do it in this console. So if I go to, um volumes circuit python Waves and I'll do move zero one to ice cream Truck.wave So that just renamed it ice cream truck.wave. It doesn't have the i uh And then I will uh Run disco tool again to get back to Watching the ripple Uh control d Should restart the No, it's just yeah, I don't know why So so bizarre computers, right? Uh, let me know in either of the chats if you have your thoughts on that, but it just I'm guessing it's some sort of a timing thing um Let me just put another delay in time sleep Nope It's super weird. It wasn't happening on my other computer. I don't know why Uh, computers are weird. Okay, so let me know if you have any other thoughts or questions In the chats, but that uh, I've been taking pictures of this. I'm going to put together a guide and uh, you may or may not want to um Modify this exact toy, but hopefully it'll be a useful guide for people who want to go uh, and and Add their own functionality to a toy particularly sound toys. That's pretty common and a fun one to Be able to change because if you look at the original Uh chip on here and I didn't all actually for this one. I modified nothing other than soldering to it I didn't modify. I don't think anything on this board other than I yanked out the speaker and the uh power Wires so it's not actually doing anything anymore, but if you Uh, take a look there That epoxy blob There's a chip in there and that's what's going to contain the the sound files as well as in this case. I think the The actual microcontroller that knows to do stuff when buttons get pressed the There's just almost zero chance that you'll ever be able to change the Sounds on one of these chips. They're just epoxy down You know unless you're going to go in there be a real forensic scientist about it and Melt away the epoxy and figure out what the chip is and try to Um Reflesh it somehow It's just not really there's no circuit bending these kind of toys really Not much. I think there are some some passives on here So you might be able to do some circuit bending but as far as actually changing out sounds I think the the better bet is to take over the parts That are great like this button pad and then Insert your stuff that uh, they can play your own sounds Maybe put a print before the list print I'll try anything. Let's see Maybe put a print before the list prints So Yeah, just like print Foo Whoops It's not plugged in Okay, that resaved That worked Hey, nice kaioshi. It it wanted a sacrificial print statement weird It just wanted to get one print out of its system Super strange All right, I should add a print at the very top then maybe I'm gonna put a note. So I remember why first list item print properly weird All right Bizarre everyone agrees right the weirdest thing that I'll probably see today. That's my guess. Yay. We have a nice list now Okay, so I can pull this off of here. I can now power it on from battery and I didn't change anything other than the file name But you see there Changing that file name I'm very happy that I don't have any file names hard-coded into this. It is So long as we're following an alphabetical order and in this case. I'm using zero one through 12 but any kind of Alphabetical order would work with the way I'm I'm sorting this list We still get ice cream truck first motorcycle Jackhammer and my favorite. So I think that's going to do it Let's see before I go, uh, I will mention that you can get 10 off in the store if you want to go get some of this good stuff, uh And while I'm doing that, I'll show you What a couple of those products are so This is the uh, the main microcontroller that's running the the show inside of here the kb2040 The amplifier is That one right there. It's a three watt max i2s amplifier and the Mini boost We have two of these the one i'm using is that one right there the five Bolt one amp tps 61023 Now it comes in stylish purple when I have his black there, but you get a stylish purple version of that That is it and a in a perma proto board and uh, this is the quarter size perma proto Right there you get three pack you can get Just one of them for two dollars 95 cents or out of the three pack but you can pick up one of those for 295 But any of this good stuff if you go and put in your cart, uh, don't forget to type in soundscape On the way out and you'll get your 10 off And I think That is going to do it for today. So Thanks everyone for stopping by for ate a fruit industries. I'm john park. This has been john park's workshop. Bye. Bye