I have tested your code on my arduino and if you remove one of the two "/" characters on the first line, it works perfectly.
It gives an accurate 40kHz modulation and the correct output for vol+
I suspect that the problem lies with IR LED drive current as others have suggested. 39 Ohms using +5V and driver transistor is a good, safe combination for reasonable range. Most IR LEDs can handle 100mA continuously.
I use two IR LEDs each with its own 10 Ohm resistor. Each LED can handle 100mA average, and 1A for very short duration. Your program outputs a 1/3 duty cycle, so I am able to drive 30mA per LED and still stay within 100mA average spec. This may be a risky thing to do in an experimental environment, as a permanent high will overload the IR LEDs.
What you can achieve depends on the spec of the IR LEDs that you are using.
In summary, use a transistor, 5V supply, 39 Ohms (or less if you dare) and maybe multiple IR LEDs.