{"repo":"adamstark/AudioFile","free":true,"listed":false,"github":"https://github.com/adamstark/AudioFile","clone":"git clone https://github.com/adamstark/AudioFile.git","description":"A simple C++ library for reading and writing audio files.","language":"C++","stars":1146,"topics":["audio","file-format","wav","aif","audio-files","audio-formats","read","write"],"license":"MIT","category":"media-processing","readme_excerpt":"AudioFile A simple header-only C++ library for reading and writing audio files. Current supported formats: - WAV - AIFF Author AudioFile is written and maintained by Adam Stark. http://www.adamstark.co.uk Usage Create an AudioFile object: #include \"AudioFile.h\" AudioFile audioFile; Load an audio file: audioFile.load (\"/path/to/my/audiofile.wav\"); Get some information about the loaded audio: int sampleRate = audioFile.getSampleRate(); int bitDepth = audioFile.getBitDepth(); int numSamples = audioFile.getNumSamplesPerChannel(); double lengthInSeconds = audioFile.getLengthInSeconds(); int numChannels = audioFile.getNumChannels(); bool isMono = audioFile.isMono(); bool isStereo = audioFile.isStereo(); // or, just use this quick shortcut to print a summary to the console audioFile.printSummary(); Access the samples directly: int channel = 0; int numSamples = audioFile.getNumSamplesPerChannel(); for (int i = 0; i ::AudioBuffer buffer; // 2. Set to (e.g.) two channels buffer.resize (2); // 3. Set number of samples per channel buffer[0].resize (100000); buffer[1].resize (100000); // 4. do something here to fill the buffer with samples, e.g. #include // somewhere earler (for M PI and sinf()) // then... int numChannels = 2; int numSamplesPerChannel = 100000; float sampleRate = 44100.f; float frequency = 440.f; for (int i = 0; i fileData; audioFile.saveToMemory (fileData, AudioFileFormat::Wave); or audioFile.saveToMemory (fileData, AudioFileFormat::Aiff); Examples Please see the example","default_branch":null,"files":null,"tree":[],"storefront":"/r/adamstark","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/adamstark/AudioFile/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}