No resistor at all. Once again, questions should stick to what you want to know or accomplish, not how you think it should be done.
Your basic question is apparently how to power this "speaker" (clearly more than just a speaker) from the power source you supply rather than the two AAA batteries it is designed for. You have available some sort of lithium battery and a regulated 5 V supply generated from that somehow.
First, you need to find out whether the batteries in your speaker unit are ground-referenced. If they are, you can proceed. If not, then this is beyond your level at this time and you either need to find a different speaker unit or a altogether different approach. Run the speaker normally with a fairly strong signal into it. With a voltmeter, measure between the negative terminal of the combined AAA battery pack and the outer ring of the 3.5 mm plug. There should be 0 V, both when measuring AC and DC. Of course exactly 0 will never happen, so in this case anything over about 10 mV means the two points aren't really connected. If they are connected, then the battery is ground-referenced and you can proceed.
If the lithium battery voltage is around 3 V, then use it directly. If this battery is a single cell, this might just work. Basically, if the lithium battery voltage is below the regulated 5 V output, try connecting the battery to the + side of where the AAA pair would go, and ground to the - side.
If the lithium battery voltage is higher than 5 V, then it would be best to to use that directly to make some sort of regulated 3 V to drive the speaker unit with. A linear 3.3 V regulator is a quick and simple answer, but might get warm when the speaker is producing loud sound. Try it and see. If that is not acceptable or the lithium battery voltage is substantially higher than 5 V, then use a switching regulator instead. There are many switching regulator chips out there that can do this with a few external parts. You can even use one that has a fixed 3.3 V output.
Added:
You now say the lithium battery puts out 7.4 V and the link to the speaker unit rates it as 1/2 W, but it's not clear if that is input power or power to the speaker. Just to see where you're at, .5W / 3V = 170 mA. We can't really tell from the sparse information in the link, but lets say top current draw of the speaker unit is 200 mA at 3 V. With just a linear regulator, the regulator would dissipate (7.4V - 3V) * 200mA = 880 mW. That's rather wasteful and something like a TO-220 package will get hot but probably OK with a modest heat sink. You can try a 7803 regulator.
The other thing to try is to power the speaker unit from your existing 5 V source. I don't know what a "BEC" is, so can't tell if this is a linear or switching regulator and how much current it can support. The speaker will draw more current at 5 V than at 3 V. If a lot more, it may get damaged. After all, it's meant to run from 3 V. 5 V may be OK, but you're a test pilot then and you can't complain if it vanishes into a greasy puff of black smoke.
The simple, first circuit will deliver 5V at 0A, and be limited to 1A but voltage will drop off rapidly with increasing load; at 1A output, it'll be delivering only 2.5V.
The more (needlessly, I might add) complicated drawing will deliver 5.6V at 0A and voltage will drop to about 4.91V at 180mA.
Neither will regulate very well, and I don't think either will do what you really want it to do.
Let's back up and find out exactly what you want to charge. Battery voltage, chemistry type, and current rating. Different batteries require different chargers, and an inappropriate one may damage batteries or start a fire.
Best Answer
Replacing a battery from a battery-operated equipment with a power supply can be tricky. Especially when the equipment uses an electric motor. The problem is that an electric motor can draw very large startup current - it can be as 10-20 times the nominal for a couple of seconds. A battery is able to supply that current, while a typical power supply with overcurrent protecton may latch or enter hiccup mode, from which it cant escape.
First of all you need to determine the nominal motor current and the maximum current. The maximum current flows when the motor is mechanically overloaded. In your case it is when you try to cut bushes or some really tough grass with your mower.
There are a couple of approaches one might try.
Put a very heavy low frequency transformer rated for the nominal current, put a diode bridge and a very large capacitor rated for the nominal current. Assume the transformer will whitstand the maximum current. In most cases it will. The drawbacks are weight, size & price. It may be heavier than your original battery.
Put a SMPS (switch mode power supply) that can withstand the maximum motor current - it will be expensive. The power supply must be enclosed this way so no water can reach it.
Put a SMPS that is designed to work with a battery and also put a battery smaller than original. - Also expensive, also must be waterproof.
Forget about all the crap and get a new battery - it is the easiest and (in the end) cheapest way.
P.S. One more thing -