mirror of
https://github.com/vale981/openAV-Luppp
synced 2025-03-05 09:01:39 -05:00
Fix buffer size for saving and loading samples (issue #174)
This commit is contained in:
parent
3b89ee90ef
commit
ad5a5f1e5b
2 changed files with 2 additions and 2 deletions
|
@ -167,7 +167,7 @@ int DiskReader::loadSample( int track, int scene, string path )
|
||||||
int chnls = infile.channels();
|
int chnls = infile.channels();
|
||||||
std::vector<float> bufL( infile.frames() );
|
std::vector<float> bufL( infile.frames() );
|
||||||
std::vector<float> bufR( infile.frames() );
|
std::vector<float> bufR( infile.frames() );
|
||||||
float frameBuf[ sizeof(float) * chnls ];
|
float frameBuf[ chnls ];
|
||||||
|
|
||||||
if ( infile.error() ) {
|
if ( infile.error() ) {
|
||||||
LUPPP_ERROR("File %s, Error %s", path.c_str(), infile.strError() );
|
LUPPP_ERROR("File %s, Error %s", path.c_str(), infile.strError() );
|
||||||
|
|
|
@ -321,7 +321,7 @@ int DiskWriter::writeAudioBuffer(int track, int scene, AudioBuffer* ab,
|
||||||
// FIXME: the size of the buffer is bigger than the audio contained in it:
|
// FIXME: the size of the buffer is bigger than the audio contained in it:
|
||||||
// calculate the length that needs saving using getBeats() * framesPerBeat
|
// calculate the length that needs saving using getBeats() * framesPerBeat
|
||||||
if ( ab->getAudioFrames() > 0 ) {
|
if ( ab->getAudioFrames() > 0 ) {
|
||||||
float frameBuf[ sizeof(float) * 2 ];
|
float frameBuf[ 2 ];
|
||||||
for(int i=0; i<ab->getAudioFrames(); i++) {
|
for(int i=0; i<ab->getAudioFrames(); i++) {
|
||||||
frameBuf[0] = ab->getDataL()[i];
|
frameBuf[0] = ab->getDataL()[i];
|
||||||
frameBuf[1] = ab->getDataR()[i];
|
frameBuf[1] = ab->getDataR()[i];
|
||||||
|
|
Loading…
Add table
Reference in a new issue