wav - pause() from audio library not working in r project -
after using play() function sound plays continuously. how stop it. code below shows used pause() function gives me error message, i've tried using close() function.
> pause(saw) error in usemethod("pause") : no applicable method 'pause' applied object of class "c('wave', 'wavegeneral')"
i guess use these 2 different packages:
tuner
import wave fileaudio
for playback functions
unfortunately these packages each have own object classes: wave
class in tuner
, audiosample
class in audio
. if want use playback functions of audio
first need object of class audiosample
. can importing wave file audio's own import function
mywav <- load.wave("myaudiosample.wav")
but since tuner
can import mp3 files , has more import options may necessary create own audiosample
object manually wave
object. simple mono file example converted following way:
mywave <- readwave("myaudiosample.wav") mywav <- audiosample(mywave@left, mywave@samp.rate, mywave@bit)
you can use playback functions audio
. make sure call audio::play()
, might masked tuner
a <- audio::play(mywav) pause(a) resume(a)
Comments
Post a Comment