| 162 | } |
| 163 | |
| 164 | bool SoundBuffer::initialize( InputSoundFile& file ) { |
| 165 | // Retrieve the sound parameters |
| 166 | Uint64 sampleCount = file.getSampleCount(); |
| 167 | unsigned int channelCount = file.getChannelCount(); |
| 168 | unsigned int sampleRate = file.getSampleRate(); |
| 169 | |
| 170 | // Read the samples from the provided file |
| 171 | mSamples.resize( static_cast<std::size_t>( sampleCount ) ); |
| 172 | if ( file.read( &mSamples[0], sampleCount ) == sampleCount ) { |
| 173 | // Update the internal buffer with the new samples |
| 174 | return update( channelCount, sampleRate ); |
| 175 | } else { |
| 176 | return false; |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | bool SoundBuffer::update( unsigned int channelCount, unsigned int sampleRate ) { |
| 181 | // Check parameters |
nothing calls this directly
no test coverage detected