Learn R Programming

soundgen (version 1.3.2)

playme: Play audio

Description

Plays an audio file or a numeric vector. This is a simple wrapper for the functionality provided by play

Usage

playme(sound, samplingRate = 16000)

Arguments

sound

a vector of numbers on any scale or a path to a .wav file

samplingRate

sampling rate (only needed if sound is a vector)

Examples

Run this code
# NOT RUN {
# playme('~/myfile.wav')
f0_Hz = 440
sound = sin(2 * pi * f0_Hz * (1:16000) / 16000)
# playme(sound, 16000)
# in case of errors, look into tuneR::play()
# }

Run the code above in your browser using DataLab