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.
Both the boost regulators you have listed have an EN input. This is used to enable or disable the regulator, and can be very simply controlled by the USB's input power:
simulate this circuit – Schematic created using CircuitLab
Under normal battery operation R3 pulls the EN pin high, so the boost regulator is enabled. When you connect the USB current flows through R1 and turns Q1 on. this pulls EN low. R2 is used to ensure Q1 switches off when there is no USB connection allowing R3 to pull EN up again.
You may want to still keep the two diodes to prevent any back-flow of current through the regulator that isn't currently in use.
Note: I chose the resistors with ball-park figures. You may need to tweak to both ensure the EN pin gets the right voltages / currents to activate, and keep your quiescent current through R3 as low as you can while the USB is connected.
Best Answer
In the end, while the LM317 worked to down-regulate the voltage to drive my AAA-pocket radio as I wanted, a 'quiescent current' was present while the speaker was switched off, so there goes that idea! Thanks for the tips, @BrianDrummond, @Passerby and @NicolasD.
While I've now resorted to rechargeable AAAs for the pocket radio instead, anyone else interested in down-regulating a 5V 1A USB source to drive a single AAA-battery powered device (like my pocket radio) could also look to the LM317.