I think you've mixed up two different things:
- voicing in compound words (連濁)
- deaspiration in non-initial position
The first one is a grammar rather than pronunciation. In most cases, whether the voicing happens or not is determined by word, and the kana spelling always reflects the pronunciation change i.e. 雲 (くも) → 雨雲 (あまぐも), 雷雲 (かみなりぐも), 浮き雲 (うきぐも) etc. You're not allowed to do such things like sometimes say あまぐも and sometimes あまくも.
Note that this rule refers historical classification of 清音/濁音, so we do 日 (ひ) → 夏日 (なつび), 曜日 (ようび) etc. even they no longer form voiced/unvoiced pair in today's pronunciation.
The second one is a pure pronunciation problem. We aspirate voiceless (stop) consonants in the beginning of word, but do not in other places: かた, とり (aspirated) vs. みかた, ことり (unaspirated). English speakers, too, aspirate them at the beginning of first or stressed syllables: pie, repine (aspirated) vs. spy, occupy (unaspirated). This doesn't mean it could change into voiced consonants. The voiceless/voiced contrast is fundamental in Japanese pronunciation.
However, if your mother tongue doesn't have this distinction, it's possible that you overlook the difference. Especially when you speak a language that counts aspiration but not voicedness (just opposite to Japanese), including Chinese, Korean, Georgian, Zulu or Scottish Gaelic, you may have false belief on sound qualities without proper care. If that's the case, what you have to do is just practice.
Technically, some languages like American English or German could have weaker voicing that the difference is mainly perceived through other factors. Japanese voicing I believe is more "typical" than them, but you can also use various side effects of voicing, such as buzzing undertone, slightly lower voice or less crisper sound, as aid of hearing.
Now I see that you have difficulties distinguishing voicedness.
Listen to it: https://clyp.it/0omton0o
I pronounced 12 pieces of sounds in total, with labial/dental/alveolar/velar consonants each combined with aspirated (VOT > 100ms), tenuis (0 < VOT < 10ms; don't mind tenseness) and voiced (VOT < -100ms) articulations.
aspirated tenuis voiced
p/b #1 #2 #3
t/d #4 #5 #6
ch/j #7 #8 #9
k/g #10 #11 #12
Basically, you have to train to accommodate yourself hearing #2, #5, #8, #11 as voiceless, and #3, #6, #9, #12 as voiced. However, there's another pitfall in Japanese, that people often use tenuis series instead of voiced series in word-initial, where unvoiced sounds are expected to be aspirated.
This post in linguistics SE would be helpful, too.