| 304 | } |
| 305 | |
| 306 | Status WriteFile(const string& filename, StringPiece contents) { |
| 307 | Env& env = *Env::Default(); |
| 308 | std::unique_ptr<WritableFile> file; |
| 309 | TF_RETURN_IF_ERROR(env.NewWritableFile(filename, &file)); |
| 310 | TF_RETURN_IF_ERROR(file->Append(contents)); |
| 311 | TF_RETURN_IF_ERROR(file->Close()); |
| 312 | return Status::OK(); |
| 313 | } |
| 314 | |
| 315 | Status ReadAudioFile(const string& filename, const string& audio_format_id, |
| 316 | int32 samples_per_second, int32 channel_count, |