How are some electronics with physical on/off switches turn off with a tune/message?
simulate this circuit &ndash; Schematic created using CircuitLab
Figure 1. A simple example circuit.
It's a common feature on microcontrollers and other devices that there is a low powered sleep mode. Notice in Figure 1 that the battery is permanently connected to V+ but the on-off switch only signals to the device whether to be on or off. Switching off will initiate switching off peripherals or doing some sequence of events (such as playing a tune in your case) before going into low-power mode. Switching on will cause a wake-up event to bring the controller back to life.
In your case the chips are probably one-time programmed. Your Bluetooth speaker circuit is unlikely to be customisable. I'd recommend finding another project!