+ case Type::SOUND:
+ {
+ dcp::SoundAsset in(input_file);
+ add_key(in, decrypted_kdm);
+ /* XXX: this is all a bit of a hack */
+ dcp::SoundAsset out(in.edit_rate(), in.sampling_rate(), in.channels(), dcp::LanguageTag(in.language().get_value_or("en-GB")), dcp::Standard::SMPTE);
+ auto writer = out.start_write(output_file.get(), {}, dcp::SoundAsset::AtmosSync::DISABLED, dcp::SoundAsset::MCASubDescriptors::DISABLED);
+ auto reader = in.start_read();
+ reader->set_check_hmac(!ignore_hmac);
+ for (int64_t i = 0; i < in.intrinsic_duration(); ++i) {
+ auto frame = reader->get_frame(i);
+ std::vector<int32_t*> pointers(frame->channels());
+ for (auto channel = 0; channel < frame->channels(); ++channel) {
+ pointers[channel] = new int32_t[frame->samples()];
+ for (auto sample = 0; sample < frame->samples(); ++sample) {
+ pointers[channel][sample] = frame->get(channel, sample);
+ }
+ }
+ writer->write(pointers.data(), frame->channels(), frame->samples());
+ for (auto channel = 0; channel < frame->channels(); ++channel) {
+ delete[] pointers[channel];
+ }
+ }
+ writer->finalize();
+ break;
+ }