| 241 | } |
| 242 | |
| 243 | bool |
| 244 | ExportSamplesTask::openWav(void) |
| 245 | { |
| 246 | SF_INFO sfinfo; |
| 247 | |
| 248 | sfinfo.channels = 2; |
| 249 | sfinfo.samplerate = static_cast<int>(fs); |
| 250 | sfinfo.format = SF_FORMAT_WAV | SF_FORMAT_FLOAT; |
| 251 | |
| 252 | if ((this->sfp = sf_open( |
| 253 | path.toStdString().c_str(), |
| 254 | SFM_WRITE, |
| 255 | &sfinfo)) == nullptr) { |
| 256 | this->lastError = |
| 257 | "Cannot open " |
| 258 | + this->path |
| 259 | + ": " |
| 260 | + QString(strerror(errno)); |
| 261 | return false; |
| 262 | } |
| 263 | |
| 264 | return true; |
| 265 | } |
| 266 | |
| 267 | bool |
| 268 | ExportSamplesTask::openRaw(void) |