| 234 | } |
| 235 | |
| 236 | void Compute(OpKernelContext* context) override { |
| 237 | // Get and verify the input data. |
| 238 | OP_REQUIRES( |
| 239 | context, context->num_inputs() == 1, |
| 240 | errors::InvalidArgument("DecodeAudio requires exactly one input.")); |
| 241 | const Tensor& contents = context->input(0); |
| 242 | OP_REQUIRES( |
| 243 | context, TensorShapeUtils::IsScalar(contents.shape()), |
| 244 | errors::InvalidArgument("contents must be scalar but got shape ", |
| 245 | contents.shape().DebugString())); |
| 246 | |
| 247 | const tensorflow::StringPiece file_contents = contents.scalar<tstring>()(); |
| 248 | Decode(context, file_contents, file_format_, samples_per_second_, |
| 249 | channel_count_, ""); |
| 250 | } |
| 251 | |
| 252 | private: |
| 253 | string file_format_; |
nothing calls this directly
no test coverage detected