| 351 | } |
| 352 | |
| 353 | Status CreateAudioFile(const string& audio_format_id, int32 bits_per_second, |
| 354 | int32 samples_per_second, int32 channel_count, |
| 355 | const std::vector<float>& samples, string* output_data) { |
| 356 | if (audio_format_id != "wav") { |
| 357 | return Status(error::Code::INVALID_ARGUMENT, |
| 358 | "CreateAudioFile only supports the 'wav' audio format."); |
| 359 | } |
| 360 | *output_data = BuildWavFile(samples_per_second, channel_count, samples); |
| 361 | return Status::OK(); |
| 362 | } |
| 363 | |
| 364 | Status ReadVideoFile(const string& filename, std::vector<uint8>* output_data, |
| 365 | uint32* width, uint32* height, uint32* frames) { |