FUNCTION REFERENCE

audiowrite

Write a WAV audio file.

Write a WAV audio file.

Syntax

audiowrite(filename, y, Fs)

Syntax

audiowrite(filename, y, Fs, 'BitsPerSample', b, 'Title', t, 'Artist', a, 'Comment', c)

y is samples by channels (a row vector is one channel) of class uint8, int16, int32, single or double. BitsPerSample is 8, 16 (default), 24, 32 or 64; 32 and 64 write floating point (int32 data writes 32-bit integers). Floating-point data outside [-1, 1] is clipped with a warning.

Example

f=[tempname(pwd) '.wav']; audiowrite(f, [0; 1], 8000); y=audioread(f, 'native'); delete(f); y   % [0; 32767] int16

Differences from MATLAB: Only .wav files; .flac, .ogg, .m4a and .mp4 are not supported yet.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.