MCPcopy Create free account
hub / github.com/SpartanJ/eepp / initialize

Method initialize

src/eepp/audio/soundbuffer.cpp:164–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162}
163
164bool 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
180bool SoundBuffer::update( unsigned int channelCount, unsigned int sampleRate ) {
181 // Check parameters

Callers

nothing calls this directly

Calls 6

updateFunction · 0.85
getSampleCountMethod · 0.45
getChannelCountMethod · 0.45
getSampleRateMethod · 0.45
resizeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected