How to make a block that saves the sound in your pc

As for the at () kHz part, I think you can just change the kHz of the samples beforehand and then save it.