mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-26 21:58:37 -05:00
Fix wrong multi-part WAV sequence management with time-limit files
This commit is contained in:
parent
3334538e64
commit
4c6d7ab4d7
@ -65,9 +65,11 @@ std::string AudioFileWAV::getExtension()
|
||||
bool AudioFileWAV::writeToFile(AudioThreadInputPtr input)
|
||||
{
|
||||
if (!outputFileStream.is_open()) {
|
||||
|
||||
std::string ofName = getOutputFileName();
|
||||
|
||||
outputFileStream.open(ofName.c_str(), std::ios::binary);
|
||||
currentFileSize = 0;
|
||||
|
||||
writeHeaderToFileStream(input);
|
||||
}
|
||||
@ -111,6 +113,7 @@ bool AudioFileWAV::closeFile()
|
||||
write_word(outputFileStream, file_length - 8, 4);
|
||||
|
||||
outputFileStream.close();
|
||||
currentFileSize = 0;
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -169,6 +172,16 @@ size_t AudioFileWAV::getMaxWritableNumberOfSamples(AudioThreadInputPtr input) {
|
||||
|
||||
}
|
||||
|
||||
void AudioFileWAV::setOutputFileName(std::string filename) {
|
||||
|
||||
if (filename != filenameBase) {
|
||||
|
||||
currentSequenceNumber = 0;
|
||||
}
|
||||
|
||||
AudioFile::setOutputFileName(filename);
|
||||
}
|
||||
|
||||
std::string AudioFileWAV::getOutputFileName() {
|
||||
|
||||
std::string recPath = wxGetApp().getConfig()->getRecordingPath();
|
||||
|
@ -13,6 +13,9 @@ public:
|
||||
AudioFileWAV();
|
||||
~AudioFileWAV();
|
||||
|
||||
//override to manage name change with multi-part WAV.
|
||||
virtual void setOutputFileName(std::string filename);
|
||||
|
||||
//override of the base method to generate multi-part
|
||||
//WAV to overcome the WAV format size limit.
|
||||
virtual std::string getOutputFileName();
|
||||
|
Loading…
Reference in New Issue
Block a user