I played 20 minutes of music with a floppy disk directly in front of the speaker's subwoofer. No damaged sectors at all.
Can a speaker actually erase a floppy disk? How close does it need to be?
It doesn’t need to be loud, it needs to be unshielded. Many speakers produced in the last 20-30 years are shielded, to avoid their magnets affecting surrounding objects — particularly CRTs (you don’t want your speakers changing the colours on your retro TV screen), but as a side-effect, magnetic media too. If you have unshielded speakers with strong enough magnets, or you place your floppies close enough to the magnet, the floppies will be affected, without even needing to play any sound.
A few years ago I've tried to ressurect a few of my cooler floppies that had bad sectors and couldn't be formatted on my Amiga 600. My approach was to leave them on my strongest speaker for about a day, then flip, and leave it for another day, then reformat and write. Surprisingly, I've got a few of those fixed that way, but I doubt that leaving a floppy for a short time on a random speaker would do anything to it, not to mention playing music, which will do literally nothing in this case.
To really damage a floppy, you would need to hold it literally on the magnet for extended periods of time, just like I did a few years back. This would still only damage the data, not wipe it clean.
If you want to check what really happens with magnetic mediums placed on speakers, a good place to start would be to get a blank audio tape, record some music onto it, leave it on the speaker for a few days, and then play it back. Notice that the sound will be much quieter with (maybe) some more hiss introduced. The hiss will be much more noticeable on silent sections. If you have a stereo player, you'll also be able to notice how one channel is much more quiet than the another.
Placing it in from of a speaker/woofer wont affect. It just creates vibrations.
You'll need a powerful magnet. You can either get it from a speaker, or make a strong electromagnet. Rub it on the magnetic tape repeatedly. That will corrupt the data on it, but I doubt that it'll erase it.
It works just same as magnetizing a metal piece by rubbing a magnet on it.
A loudspeaker has two magnets interacting: One big, usually permanent one (two-electromagnet seems to have gone out of fashion in prewar times), and an electromagnet (the voice coil). The permanent magnet is what you would normally worry about, but the field emanating from it is relatively independent of whether the loudspeaker is silent or not - you would need to physically move the floppy closer to the magnet.
The electromagnet's strength is indeed dependent on sound input - how much of that magnetism actually leaves the loudspeaker is extremely dependent on the actual loudspeaker design at hand. Conceivably, fields from both magnets adding up during a particularly loud sound event could overcome the coercivity of the floppy drive and indeed cause spurious erasure - all very dependent, again, on the exact loudspeaker.
If you want to get an idea about magnetic fields in front of the loudspeaker - just find an old fashioned compass, it can tell you quite a bit.
If you want to be sure to AVOID such damage, check what the loudspeaker manufacturer has to say about safe distances for ATM cards.