Electrically Controlled Quantum Memories With a Cavity and Electro-Mechanical System