Hello from JustAnswer.
Yes, these drugs can be taken together, although it is appropriate to be cautious. Since both medicines can cause drowsiness, taking both medicines has a greater risk of drowsiness than taking either alone. And it is also possible to develop other brain symptoms related to this, such as dizziness or slowed thinking or responsiveness. The effect also may be more of an issue when performing activities that require alerttness, such as driving.
The relative risk from the combination is low, so most people are able to take both without difficulty. But it is wise to be cautious when first taking the combination until you know how it affects you. The fact that you have a heart condition does not increase the risk.
It is worth noting that when dealing with chronic pain, we frequently have to use drug combinations that can have this affect, so a similar caution should be used when combining most medicines for pain.
Therefore, yes, it is typically OK to use these medicines together, although it is appropriate to be cautious when first using them together, particularly when driving.
If i can provide any additional information, please let me know.