Find duration of wav file in r
问题 I know the equation to find the duration of a wav file is: fileLength/(sampleRate*channel*bits per sample/8) But I've failed to retrieve all the necessary information to fill this equation in R. Here is an example of what I've come up with: sound <- readWave(sound.wav) sampleRate <- sound@samp.rate #44100 bit <- sound@bit #16 So from the information above I have: fileLength/(44100*channel*16/8) The channel will either be 1 or 2, so that I'm not bothered about, but what about the file length?