Learn R Programming

seewave (version 1.6.3)

wav2flac: wav-flac file conversion

Description

This function converts .wav files into .flac files and reversely

Usage

wav2flac(file, reverse = FALSE, overwrite = FALSE,
exename = NULL, path2exe = NULL)

Arguments

Value

  • A new file is created.

Details

The function runs FLAC. FLAC has then to be installed first: http://flac.sourceforge.net/, if not the function will not work.

References

FLAC website: http://flac.sourceforge.net/

See Also

savewav

Examples

Run this code
if(nzchar(Sys.which("flac"))) # check that FLAC is installed on your system
{
# synthesis of a 1kHz sound
a<-synth(d=10,f=8000,cf=1000)
# save it as a .wav file in the default working directory
savewav(a,f=8000)
# compress it to FLAC format and overwrite on the file a.wav
wav2flac("a.wav", overwrite=TRUE)
# back to .wav format
wav2flac("a.flac", reverse=TRUE)
# remove the files
unlink(c("a.wav","a.flac"))
}

Run the code above in your browser using DataLab