TensorFlow wav_to_spectrogram wav file format












0















Reading the wav_to_spectrogram example from TensorFlow, it is said that To load your own audio, you need to supply a .wav file in LIN16 format. I have a wav file with the following information



$ mplayer -identify wrecking_crew.wav 
MPlayer 1.3.0 (Debian), built with gcc-7 (C) 2000-2016 MPlayer Team
do_connect: could not connect to socket
connect: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing wrecking_crew.wav.
libavformat version 57.83.100 (external)
ID_AUDIO_ID=0
Audio only file format detected.
Load subtitles in ./
ID_FILENAME=wrecking_crew.wav
ID_DEMUXER=audio
ID_AUDIO_FORMAT=1
ID_AUDIO_BITRATE=352800
ID_AUDIO_RATE=0
ID_AUDIO_NCH=1
ID_START_TIME=0.00
ID_LENGTH=48694.00
ID_SEEKABLE=1
ID_CHAPTERS=0
==========================================================================
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
AUDIO: 22050 Hz, 1 ch, s16le, 352.8 kbit/100.00% (ratio: 44100->44100)
ID_AUDIO_BITRATE=352800
ID_AUDIO_RATE=22050
ID_AUDIO_NCH=1
Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
=========================================================================
AO: [pulse] 22050Hz 1ch s16le (2 bytes per sample)
ID_AUDIO_CODEC=pcm
Video: no video
Starting playback...
A: 8.4 (08.3) of 48694.0 (13:31:34.0) 0.0%
Audio output truncated at end.
A: 8.4 (08.4) of 48694.0 (13:31:34.0) 0.0%


Exiting... (End of file)
ID_EXIT=EOF


However, TensorFlow aborts the execution with the following error



$ bazel-bin/tensorflow/examples/wav_to_spectrogram/wav_to_spectrogram --input_wav=../wrecking_crew.wav
2019-01-19 21:38:51.292782: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
2019-01-19 21:38:51.294078: I tensorflow/stream_executor/platform/default/dso_loader.cc:154] successfully opened CUDA library libcuda.so.1 locally
2019-01-19 21:38:51.361657: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1003] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2019-01-19 21:38:51.362134: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1434] Found device 0 with properties:
name: Quadro M2000 major: 5 minor: 2 memoryClockRate(GHz): 1.1625
pciBusID: 0000:26:00.0
totalMemory: 3.95GiB freeMemory: 3.78GiB
2019-01-19 21:38:51.362153: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1513] Adding visible gpu devices: 0
2019-01-19 21:38:51.362752: I tensorflow/core/common_runtime/gpu/gpu_device.cc:985] Device interconnect StreamExecutor with strength 1 edge matrix:
2019-01-19 21:38:51.362762: I tensorflow/core/common_runtime/gpu/gpu_device.cc:991] 0
2019-01-19 21:38:51.362767: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1004] 0: N
2019-01-19 21:38:51.362900: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1116] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 3566 MB memory) -> physical GPU (device: 0, name: Quadro M2000, pci bus id: 0000:26:00.0, compute capability: 5.2)
2019-01-19 21:38:51.411588: W tensorflow/core/framework/op_kernel.cc:1412] OP_REQUIRES failed at decode_wav_op.cc:55 : Invalid argument: Data too short when trying to read string
2019-01-19 21:38:51.412591: W tensorflow/core/framework/op_kernel.cc:1412] OP_REQUIRES failed at decode_wav_op.cc:55 : Invalid argument: Data too short when trying to read string
2019-01-19 21:38:51.412970: E tensorflow/examples/wav_to_spectrogram/main.cc:61] WavToSpectrogram failed with Invalid argument: Data too short when trying to read string
[[{{node wav_decoder}}]]
[[spectrogram/_1]]


Is that related to LIN16 format? What should I do?










share|improve this question



























    0















    Reading the wav_to_spectrogram example from TensorFlow, it is said that To load your own audio, you need to supply a .wav file in LIN16 format. I have a wav file with the following information



    $ mplayer -identify wrecking_crew.wav 
    MPlayer 1.3.0 (Debian), built with gcc-7 (C) 2000-2016 MPlayer Team
    do_connect: could not connect to socket
    connect: No such file or directory
    Failed to open LIRC support. You will not be able to use your remote control.

    Playing wrecking_crew.wav.
    libavformat version 57.83.100 (external)
    ID_AUDIO_ID=0
    Audio only file format detected.
    Load subtitles in ./
    ID_FILENAME=wrecking_crew.wav
    ID_DEMUXER=audio
    ID_AUDIO_FORMAT=1
    ID_AUDIO_BITRATE=352800
    ID_AUDIO_RATE=0
    ID_AUDIO_NCH=1
    ID_START_TIME=0.00
    ID_LENGTH=48694.00
    ID_SEEKABLE=1
    ID_CHAPTERS=0
    ==========================================================================
    Opening audio decoder: [pcm] Uncompressed PCM audio decoder
    AUDIO: 22050 Hz, 1 ch, s16le, 352.8 kbit/100.00% (ratio: 44100->44100)
    ID_AUDIO_BITRATE=352800
    ID_AUDIO_RATE=22050
    ID_AUDIO_NCH=1
    Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
    =========================================================================
    AO: [pulse] 22050Hz 1ch s16le (2 bytes per sample)
    ID_AUDIO_CODEC=pcm
    Video: no video
    Starting playback...
    A: 8.4 (08.3) of 48694.0 (13:31:34.0) 0.0%
    Audio output truncated at end.
    A: 8.4 (08.4) of 48694.0 (13:31:34.0) 0.0%


    Exiting... (End of file)
    ID_EXIT=EOF


    However, TensorFlow aborts the execution with the following error



    $ bazel-bin/tensorflow/examples/wav_to_spectrogram/wav_to_spectrogram --input_wav=../wrecking_crew.wav
    2019-01-19 21:38:51.292782: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
    2019-01-19 21:38:51.294078: I tensorflow/stream_executor/platform/default/dso_loader.cc:154] successfully opened CUDA library libcuda.so.1 locally
    2019-01-19 21:38:51.361657: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1003] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
    2019-01-19 21:38:51.362134: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1434] Found device 0 with properties:
    name: Quadro M2000 major: 5 minor: 2 memoryClockRate(GHz): 1.1625
    pciBusID: 0000:26:00.0
    totalMemory: 3.95GiB freeMemory: 3.78GiB
    2019-01-19 21:38:51.362153: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1513] Adding visible gpu devices: 0
    2019-01-19 21:38:51.362752: I tensorflow/core/common_runtime/gpu/gpu_device.cc:985] Device interconnect StreamExecutor with strength 1 edge matrix:
    2019-01-19 21:38:51.362762: I tensorflow/core/common_runtime/gpu/gpu_device.cc:991] 0
    2019-01-19 21:38:51.362767: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1004] 0: N
    2019-01-19 21:38:51.362900: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1116] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 3566 MB memory) -> physical GPU (device: 0, name: Quadro M2000, pci bus id: 0000:26:00.0, compute capability: 5.2)
    2019-01-19 21:38:51.411588: W tensorflow/core/framework/op_kernel.cc:1412] OP_REQUIRES failed at decode_wav_op.cc:55 : Invalid argument: Data too short when trying to read string
    2019-01-19 21:38:51.412591: W tensorflow/core/framework/op_kernel.cc:1412] OP_REQUIRES failed at decode_wav_op.cc:55 : Invalid argument: Data too short when trying to read string
    2019-01-19 21:38:51.412970: E tensorflow/examples/wav_to_spectrogram/main.cc:61] WavToSpectrogram failed with Invalid argument: Data too short when trying to read string
    [[{{node wav_decoder}}]]
    [[spectrogram/_1]]


    Is that related to LIN16 format? What should I do?










    share|improve this question

























      0












      0








      0








      Reading the wav_to_spectrogram example from TensorFlow, it is said that To load your own audio, you need to supply a .wav file in LIN16 format. I have a wav file with the following information



      $ mplayer -identify wrecking_crew.wav 
      MPlayer 1.3.0 (Debian), built with gcc-7 (C) 2000-2016 MPlayer Team
      do_connect: could not connect to socket
      connect: No such file or directory
      Failed to open LIRC support. You will not be able to use your remote control.

      Playing wrecking_crew.wav.
      libavformat version 57.83.100 (external)
      ID_AUDIO_ID=0
      Audio only file format detected.
      Load subtitles in ./
      ID_FILENAME=wrecking_crew.wav
      ID_DEMUXER=audio
      ID_AUDIO_FORMAT=1
      ID_AUDIO_BITRATE=352800
      ID_AUDIO_RATE=0
      ID_AUDIO_NCH=1
      ID_START_TIME=0.00
      ID_LENGTH=48694.00
      ID_SEEKABLE=1
      ID_CHAPTERS=0
      ==========================================================================
      Opening audio decoder: [pcm] Uncompressed PCM audio decoder
      AUDIO: 22050 Hz, 1 ch, s16le, 352.8 kbit/100.00% (ratio: 44100->44100)
      ID_AUDIO_BITRATE=352800
      ID_AUDIO_RATE=22050
      ID_AUDIO_NCH=1
      Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
      =========================================================================
      AO: [pulse] 22050Hz 1ch s16le (2 bytes per sample)
      ID_AUDIO_CODEC=pcm
      Video: no video
      Starting playback...
      A: 8.4 (08.3) of 48694.0 (13:31:34.0) 0.0%
      Audio output truncated at end.
      A: 8.4 (08.4) of 48694.0 (13:31:34.0) 0.0%


      Exiting... (End of file)
      ID_EXIT=EOF


      However, TensorFlow aborts the execution with the following error



      $ bazel-bin/tensorflow/examples/wav_to_spectrogram/wav_to_spectrogram --input_wav=../wrecking_crew.wav
      2019-01-19 21:38:51.292782: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
      2019-01-19 21:38:51.294078: I tensorflow/stream_executor/platform/default/dso_loader.cc:154] successfully opened CUDA library libcuda.so.1 locally
      2019-01-19 21:38:51.361657: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1003] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
      2019-01-19 21:38:51.362134: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1434] Found device 0 with properties:
      name: Quadro M2000 major: 5 minor: 2 memoryClockRate(GHz): 1.1625
      pciBusID: 0000:26:00.0
      totalMemory: 3.95GiB freeMemory: 3.78GiB
      2019-01-19 21:38:51.362153: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1513] Adding visible gpu devices: 0
      2019-01-19 21:38:51.362752: I tensorflow/core/common_runtime/gpu/gpu_device.cc:985] Device interconnect StreamExecutor with strength 1 edge matrix:
      2019-01-19 21:38:51.362762: I tensorflow/core/common_runtime/gpu/gpu_device.cc:991] 0
      2019-01-19 21:38:51.362767: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1004] 0: N
      2019-01-19 21:38:51.362900: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1116] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 3566 MB memory) -> physical GPU (device: 0, name: Quadro M2000, pci bus id: 0000:26:00.0, compute capability: 5.2)
      2019-01-19 21:38:51.411588: W tensorflow/core/framework/op_kernel.cc:1412] OP_REQUIRES failed at decode_wav_op.cc:55 : Invalid argument: Data too short when trying to read string
      2019-01-19 21:38:51.412591: W tensorflow/core/framework/op_kernel.cc:1412] OP_REQUIRES failed at decode_wav_op.cc:55 : Invalid argument: Data too short when trying to read string
      2019-01-19 21:38:51.412970: E tensorflow/examples/wav_to_spectrogram/main.cc:61] WavToSpectrogram failed with Invalid argument: Data too short when trying to read string
      [[{{node wav_decoder}}]]
      [[spectrogram/_1]]


      Is that related to LIN16 format? What should I do?










      share|improve this question














      Reading the wav_to_spectrogram example from TensorFlow, it is said that To load your own audio, you need to supply a .wav file in LIN16 format. I have a wav file with the following information



      $ mplayer -identify wrecking_crew.wav 
      MPlayer 1.3.0 (Debian), built with gcc-7 (C) 2000-2016 MPlayer Team
      do_connect: could not connect to socket
      connect: No such file or directory
      Failed to open LIRC support. You will not be able to use your remote control.

      Playing wrecking_crew.wav.
      libavformat version 57.83.100 (external)
      ID_AUDIO_ID=0
      Audio only file format detected.
      Load subtitles in ./
      ID_FILENAME=wrecking_crew.wav
      ID_DEMUXER=audio
      ID_AUDIO_FORMAT=1
      ID_AUDIO_BITRATE=352800
      ID_AUDIO_RATE=0
      ID_AUDIO_NCH=1
      ID_START_TIME=0.00
      ID_LENGTH=48694.00
      ID_SEEKABLE=1
      ID_CHAPTERS=0
      ==========================================================================
      Opening audio decoder: [pcm] Uncompressed PCM audio decoder
      AUDIO: 22050 Hz, 1 ch, s16le, 352.8 kbit/100.00% (ratio: 44100->44100)
      ID_AUDIO_BITRATE=352800
      ID_AUDIO_RATE=22050
      ID_AUDIO_NCH=1
      Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
      =========================================================================
      AO: [pulse] 22050Hz 1ch s16le (2 bytes per sample)
      ID_AUDIO_CODEC=pcm
      Video: no video
      Starting playback...
      A: 8.4 (08.3) of 48694.0 (13:31:34.0) 0.0%
      Audio output truncated at end.
      A: 8.4 (08.4) of 48694.0 (13:31:34.0) 0.0%


      Exiting... (End of file)
      ID_EXIT=EOF


      However, TensorFlow aborts the execution with the following error



      $ bazel-bin/tensorflow/examples/wav_to_spectrogram/wav_to_spectrogram --input_wav=../wrecking_crew.wav
      2019-01-19 21:38:51.292782: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
      2019-01-19 21:38:51.294078: I tensorflow/stream_executor/platform/default/dso_loader.cc:154] successfully opened CUDA library libcuda.so.1 locally
      2019-01-19 21:38:51.361657: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1003] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
      2019-01-19 21:38:51.362134: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1434] Found device 0 with properties:
      name: Quadro M2000 major: 5 minor: 2 memoryClockRate(GHz): 1.1625
      pciBusID: 0000:26:00.0
      totalMemory: 3.95GiB freeMemory: 3.78GiB
      2019-01-19 21:38:51.362153: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1513] Adding visible gpu devices: 0
      2019-01-19 21:38:51.362752: I tensorflow/core/common_runtime/gpu/gpu_device.cc:985] Device interconnect StreamExecutor with strength 1 edge matrix:
      2019-01-19 21:38:51.362762: I tensorflow/core/common_runtime/gpu/gpu_device.cc:991] 0
      2019-01-19 21:38:51.362767: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1004] 0: N
      2019-01-19 21:38:51.362900: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1116] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 3566 MB memory) -> physical GPU (device: 0, name: Quadro M2000, pci bus id: 0000:26:00.0, compute capability: 5.2)
      2019-01-19 21:38:51.411588: W tensorflow/core/framework/op_kernel.cc:1412] OP_REQUIRES failed at decode_wav_op.cc:55 : Invalid argument: Data too short when trying to read string
      2019-01-19 21:38:51.412591: W tensorflow/core/framework/op_kernel.cc:1412] OP_REQUIRES failed at decode_wav_op.cc:55 : Invalid argument: Data too short when trying to read string
      2019-01-19 21:38:51.412970: E tensorflow/examples/wav_to_spectrogram/main.cc:61] WavToSpectrogram failed with Invalid argument: Data too short when trying to read string
      [[{{node wav_decoder}}]]
      [[spectrogram/_1]]


      Is that related to LIN16 format? What should I do?







      tensorflow






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 19 at 18:15









      mahmoodmahmood

      7,5653090139




      7,5653090139
























          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54270011%2ftensorflow-wav-to-spectrogram-wav-file-format%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54270011%2ftensorflow-wav-to-spectrogram-wav-file-format%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Liquibase includeAll doesn't find base path

          How to use setInterval in EJS file?

          Petrus Granier-Deferre