| 67 | } |
| 68 | |
| 69 | static bool SetBankSource(MixerChannel *mc, SoundEntry *sound, SoundID sound_id) |
| 70 | { |
| 71 | assert(sound != nullptr); |
| 72 | |
| 73 | if (sound->file != nullptr) { |
| 74 | if (!LoadSound(*sound, sound_id)) { |
| 75 | /* Mark as invalid. */ |
| 76 | sound->file = nullptr; |
| 77 | return false; |
| 78 | } |
| 79 | sound->file = nullptr; |
| 80 | } |
| 81 | |
| 82 | /* Check for valid sound. */ |
| 83 | if (sound->data->empty()) return false; |
| 84 | |
| 85 | MxSetChannelRawSrc(mc, sound->data, sound->rate, sound->bits_per_sample == 16); |
| 86 | |
| 87 | return true; |
| 88 | } |
| 89 | |
| 90 | void InitializeSound() |
| 91 | { |
no test coverage detected