audiowrite
Writes audio data to an audio file using functions defined in the Audio library. Currently only .wav format files in PCM audio format are supported.
Syntax
audiowrite(filename, data, sampleRate)
audiowrite(filename, data, sampleRate, param, value)
Inputs
- filename
- Audio file name. Currently, only .wav format files are supported.
- data
- Audio data, which is a 2D real matrix.
- sampleRate
- Sample rate or the samples(blocks) per second
- param-value(optional)
- Optional param-value pairs which specify the parameters of
the audio data written infilename. The following
are the valid parameter names and their values:
- artist: artist
- Name of the artist.
- comment: comment
- Comments.
- title: title
- Title of the audio file.
- bitspersample: bitspersample
- Number of bits per sample.
Example
Write audio data to a wav file:
inputdata = audioread('input.wav');
audiowrite('audio1.wav', inputdata, 8000, 'artist', 'Artist1', 'title', 'Some title');