| 156 | } |
| 157 | |
| 158 | int b3SoundEngine::loadWavFile(const char* fileName) |
| 159 | { |
| 160 | int* wavUidPtr = m_data->m_name2wav[fileName]; |
| 161 | if (wavUidPtr) |
| 162 | { |
| 163 | return *wavUidPtr; |
| 164 | } |
| 165 | char resourcePath[1024]; |
| 166 | |
| 167 | if (b3ResourcePath::findResourcePath(fileName, resourcePath, 1024, 0)) |
| 168 | { |
| 169 | b3ReadWavFile* wavFile = new b3ReadWavFile(); |
| 170 | wavFile->getWavInfo(resourcePath); |
| 171 | wavFile->resize(); |
| 172 | wavFile->read(0, true); |
| 173 | wavFile->normalize(1); |
| 174 | int wavUID = m_data->m_wavFileUidGenerator++; |
| 175 | m_data->m_wavFiles.insert(wavUID, wavFile); |
| 176 | m_data->m_name2wav.insert(fileName, wavUID); |
| 177 | return wavUID; |
| 178 | } |
| 179 | return 0; |
| 180 | } |
| 181 | |
| 182 | double b3SoundEngine::getSampleRate() const |
| 183 | { |
no test coverage detected