Is it safe to build a floatable speaker?
You don't need to build anything, there are lots of floating waterproof sound systems available for a reasonable price (under $40) such as this one from Amazon:



which has a rechargeable battery and Bluetooth.  You can find others by searching for waterproof pool speakers.  Put your Smartphone inside a $8 waterproof case and you're good to go.