Signal/Geometry Processing Library (SPL) 1.1.24 |

Functions
Audio Codecs
Audio and Image Codecs

Audio file I/O support. More...

## Functions
int | SPL::loadAudioFile (const std::string &fileName, int &samplingRate, RealArray1 &samples)
| Read audio data from a file in WAV format. More...
int | SPL::saveAudioFile (const std::string &fileName, int samplingRate, const RealArray1 &samples)
| Write a sequence to a file in WAV format. More...

## Detailed Description

Audio file I/O support.

## Function Documentation

int SPL::loadAudioFile | ( | const std::string & | fileName,
|  | int & | samplingRate,
|  | RealArray1 & | samples
| ) |  |

Read audio data from a file in WAV format.

Effects: The audio signal from the file named fileName in WAV format is read. The sample data is placed in the array samples and the sampling rate is placed in samplingRate. If the file has more than one channel, only the first channel is read. The sample data will always lie in the range [-1.0, 1.0].

Returns: On success, zero is returned. On failure, a nonzero value is returned.

int SPL::saveAudioFile | ( | const std::string & | fileName,
|  | int | samplingRate,
|  | const RealArray1 & | samples
| ) |  |

Write a sequence to a file in WAV format.

Effects: The sequence seq with sampling rate samplingRate is written to the file named fileName in WAV format. The sample data must lie in the range [-1.0, 1.0].

Returns: On success, zero is returned. On failure, a nonzero value is returned.