static
| 161 | |
| 162 | //static |
| 163 | bool Sample::WriteDataToFile(const std::string& path, float** data, int numSamples, int channels) |
| 164 | { |
| 165 | auto wavFormat = std::make_unique<juce::WavAudioFormat>(); |
| 166 | juce::File outputFile(ofToSamplePath(path)); |
| 167 | outputFile.create(); |
| 168 | auto outputTo = outputFile.createOutputStream(); |
| 169 | assert(outputTo != nullptr); |
| 170 | bool b1{ false }; |
| 171 | auto writer = std::unique_ptr<juce::AudioFormatWriter>( |
| 172 | wavFormat->createWriterFor(outputTo.release(), gSampleRate, channels, 16, b1, 0)); |
| 173 | writer->writeFromFloatArrays(data, channels, numSamples); |
| 174 | |
| 175 | return true; |
| 176 | } |
| 177 | |
| 178 | //static |
| 179 | bool Sample::WriteDataToFile(const std::string& path, ChannelBuffer* data, int numSamples) |
nothing calls this directly
no test coverage detected