Learn R Programming

musicNMR (version 1.0)

musicMatrix: Save an Audio File from a Matrix

Description

This function save a matrix in audio file as *.wav

Usage

musicMatrix(ma,destination)

Value

No return value.

Arguments

ma

a matrix. The time in second unit is in the firt column. The intensity of the FID is in the second column.

destination

Name of the .wav file

Author

Stefano Cacciatore

Details

This function uses - three functions from the package tuneR: Wave, normalize and writeWave; - one function from the package seewave: savewav.

References

Cacciatore S, Saccenti E, Piccioli M. Hypothesis: the sound of the individual metabolic phenotype? Acoustic detection of NMR experiments. OMICS. 2015 Mar;19(3):147-56.

Examples

Run this code

data(AU)
musicMatrix(AU$sample1A,"audio.wav")

# The function unlink deletes the file
unlink("audio.wav")

Run the code above in your browser using DataLab