Getting broken radio sound with tuneR::writeWave

35 views Asked by At

I have this Wave object (from the tuneR R package):

> wav

Wave Object
    Number of Samples:      32000
    Duration (seconds):     1
    Samplingrate (Hertz):   32000
    Channels (Mono/Stereo): Stereo
    PCM (integer format):   TRUE
    Bit (8/16/24/32/64):    16 

> str(wav)
Formal class 'Wave' [package "tuneR"] with 6 slots
  ..@ left     : num [1:32000] 0 0 0 0 0 0 0 0 0 0 ...
  ..@ right    : num [1:32000] -244 -244 -244 -244 -244 -244 -244 -244 -244 -244 ...
  ..@ stereo   : logi TRUE
  ..@ samp.rate: num 32000
  ..@ bit      : int 16
  ..@ pcm      : logi TRUE

I am trying to put this object through tuneR::writeWave(wav, my_file_path) to create an Wave file. When I listen to the audio output, it sounds like a broken radio. Very odd.

Just by looking at the two outputs above, can you figure out what the problem is? I tried posting the output of dput(wav), but it was very long and unwieldy.

0

There are 0 answers